Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript update breaks useStateValue typings #6

Open
kalvinpearce opened this issue Mar 26, 2020 · 1 comment
Open

Typescript update breaks useStateValue typings #6

kalvinpearce opened this issue Mar 26, 2020 · 1 comment

Comments

@kalvinpearce
Copy link
Owner

I am trying to update deps to fix audit issues.

When updating with npm audit fix --force it updated jest which resulted in a bunce of new errors. tsc was checking files inside node_modules so I found a potential solution was to use skipLibChecks: true in the tsconfig.json. However this fix needed typescript to be upgraded to >=3.7.3. When upgrading typescript to anything over 3.7.2 it breaks the following code, specifically line 100: statePath

seorsum/src/index.ts

Lines 93 to 103 in 6c8ce7c

const useStateValue = <PPath extends Path<S, PPath>, S extends State = State>(
statePath: PPath,
) => {
const [value, setValue] = React.useState(
getFromPath<S, PPath>(state as S, statePath),
);
React.useEffect(() => {
return subscribe(statePath, setValue);
}, []);
return value;
};

@kalvinpearce
Copy link
Owner Author

@JamesYFC any chance you can help with this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant