We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I found this codesandbox that was shared by a Grammarly in an engineering post
In line 89 and 90, there is a Typescript compilation error
const alerts = props.state.lens("alerts"); const highlights = props.state.lens("highlights");
Property 'lens' does not exist on type 'ReadOnlyAtom<State>'
The code still works but I was intrigued by that knowing that method lens doesn't seem to appear in ReadOnlyAtom as reference here
lens
ReadOnlyAtom
Can someone explain what I could be missing here?
Should the object be Atom instead of ReadOnlyAtom?
Atom
The text was updated successfully, but these errors were encountered:
definitely, lens is defined in Atom which extends ReadOnlyAtom so the correct to use
const App = (props: { state: Atom<State> }) => { const alerts = props.state.lens("alerts"); const highlights = props.state.lens("highlights");
Sorry, something went wrong.
No branches or pull requests
I found this codesandbox that was shared by a Grammarly in an engineering post
In line 89 and 90, there is a Typescript compilation error
Property 'lens' does not exist on type 'ReadOnlyAtom<State>'
The code still works but I was intrigued by that knowing that method
lens
doesn't seem to appear inReadOnlyAtom
as reference hereCan someone explain what I could be missing here?
Should the object be
Atom
instead ofReadOnlyAtom
?The text was updated successfully, but these errors were encountered: