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 2, 2024
1 parent 325ae2e commit a9b83fd
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 a9b83fd

Please sign in to comment.