-
-
Notifications
You must be signed in to change notification settings - Fork 653
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
fix(provider): make react compiler happy #2771
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Size Change: +179 B (+0.18%) Total Size: 97.6 kB
ℹ️ View Unchanged
|
|
Playground | Link |
---|---|
React demo | https://livecodes.io?x=id/EEMG5P2KY |
See documentations for usage instructions.
/ecosystem-ci run |
Ecosystem CI Output
|
@dai-shi could this be a solution too ? export const Provider = ({
children,
store,
}: {
children?: ReactNode
store?: Store
}): FunctionComponentElement<{ value: Store | undefined }> => {
const [value] = useState(() => store || createStore())
return createElement(StoreContext.Provider, { value }, children)
} The |
Unfortunately not, because |
commit: |
…tai into fix/compiler-friendly-provider
@dai-shi what about this one? value is stable, store can change, if not supplied it would fallback to createStore() |
It works for 99.9% use cases, but React docs told us that we shouldn't use |
If we were to follow eslint-react-compiler, should this be a solution?