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

fix: use useLayoutEffect in native #2376

Merged
merged 1 commit into from
Jul 22, 2022
Merged

Conversation

CodyJasonBennett
Copy link
Member

Mirrors reduxjs/react-redux#1444 with a check for react-native in useIsomorphicLayoutEffect, so useEffect is only used server-side.

@codesandbox-ci
Copy link

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.

Latest deployment of this branch, based on commit d69781a:

Sandbox Source
example Configuration

@joshuaellis
Copy link
Member

Have you seen how I've done it in 'react-spring'? I'm wondering if that might be cleaner? Appending the file name with ".native"

@CodyJasonBennett
Copy link
Member Author

CodyJasonBennett commented Jul 19, 2022

That would be ideal, although I don't believe we can make use of platform file extensions with preconstruct (it bundles, we'd need to enable Rollup's preserveModules option -- related: pmndrs/react-ogl#60). This is how I planned to implement react-native support in use-gesture, but I've put off enhancing preconstruct for the moment.

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

Successfully merging this pull request may close these issues.

None yet

2 participants