-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
export 'useId' was not found in 'react' #381
Comments
Yeah, please do submit a PR and I'll be happy to review it! |
nwidger
pushed a commit
to nwidger/react-resizable-panels
that referenced
this issue
Jul 31, 2024
Use technique from this comment: mui/material-ui#41190 (comment) to further obfuscate reference to `React.useId` which causes issue when using `react-resizable-panels` with React <18 and `esbuild` > 0.19.5. Fixes bvaughn#381
Fix published in v2.0.23❤️ → ☕ givebrian.coffee |
@bvaughn Thanks you so much, I really appreciate it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Projects using this package and building with React <18 (the
useId
hook was introduced in React 18) andesbuild
v0.19.6 or new (v0.23.0 is the latest version) see an error similar to the following:It seems like starting with
esbuild
v0.19.6, the line here is minified from:to just:
and therefore is no longer sufficiently obfuscated. I believe this issue similar in nature to #82. It appears other projects facing similar issues have further obfuscated the reference to
React.useId
to:You can see this in action using the
esbuild
playground link below. Using the Version pulldown in the top-right you can see how the old version was sufficiently obfuscated up untilesbuild
v0.19.6, whereesbuild
apparently became smart enough to minify it to justReact.useId
.https://esbuild.github.io/try/#dAAwLjIzLjAALS1taW5pZnkALy8gY3VycmVudCB2ZXJzaW9uLCBtaW5pZmllcyB0byAiUmVhY3QudXNlSWQiClJlYWN0WyJ1c2VJZCIudG9TdHJpbmcoKV07CgovLyBwcm9wb3NlZCB2ZXJzaW9uLCBtaW5pZmllcyB0byAiUmVhY3RbYHVzZUlkJHtNYXRoLnJhbmRvbSgpfWAuc2xpY2UoMCw1KV0iClJlYWN0W2B1c2VJZCR7TWF0aC5yYW5kb20oKX1gLnNsaWNlKDAsIDUpXTs
Would you be opposed to further obfuscating this line using the
Math.random()
technique above? If so I would be happy to open a PR with the change. Thanks!The text was updated successfully, but these errors were encountered: