Consider Adding react-native to the exports Field in package.json #3086
-
Why?Zustand is widely used across multiple frameworks. As a React Native developer, I've been impressed by the convenience that Zustand offers. In React Native's default bundler, Metro, the default value for the unstable_enablePackageExports option was recently set to true. Since React Native now specifies unstable_conditionNames: ['react-native'], the bundler looks at the exports field of Zustand during the build process, leading to ESM-based bundling. However, Hermes, the JavaScript engine used by React Native, doesn't support ESM, resulting in errors. My SuggestionIn the package.json, could we add a react-native condition to the exports field and have it use CommonJS (CJS) instead of ESM? This change would help avoid the errors caused by ESM incompatibility with Hermes. With the growing number of developers using Zustand for state management in React Native, I believe this adjustment would be beneficial to many. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
See also: pmndrs/jotai#3041 (comment) I'm waiting for feedback. |
Beta Was this translation helpful? Give feedback.
See also: pmndrs/jotai#3041 (comment)
I'm waiting for feedback.