Skip to content

Commit

Permalink
Enable noImplicitAny For @tomic/react #1018
Browse files Browse the repository at this point in the history
  • Loading branch information
Polleps committed Dec 9, 2024
1 parent 42d20d0 commit 41471d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions browser/react/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function useResource<C extends OptionalClass = never>(
return resource;
}

const stableEmptyArray = [];
const stableEmptyArray: string[] = [];

/**
* Converts an array of Atomic URL strings to an array of Resources.
Expand All @@ -75,7 +75,7 @@ export function useResources(
// When a change happens, set the new Resource.
function handleNotify(updated: Resource) {
setResources(prev => {
prev.set(updated.getSubject(), proxyResource(updated));
prev.set(updated.subject, proxyResource(updated));

// We need to create new Maps for react hooks to update - React only checks references, not content
return new Map(prev);
Expand Down
30 changes: 12 additions & 18 deletions browser/react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
{
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"lib": [
"ES6",
"ES7",
"ESNext",
"DOM"
],
"rootDir": ".",
"jsx": "react",
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
"include": [
"src/**/*"
]
"extends": "../tsconfig.build.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"lib": ["ES6", "ES7", "ESNext", "DOM"],
"rootDir": ".",
"jsx": "react",
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
"include": ["src/**/*"]
}

0 comments on commit 41471d8

Please sign in to comment.