Comments (3)
https://github.com/react-hook-form/react-hook-form/blob/master/package.json#L5-L8
we wish only have to support esm.
from react-hook-form.
@bluebill1049 However, if I change the exports field in the local environment as follows, it works normally.
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"react-server": "./dist/react-server.esm.mjs",
"import": "./dist/index.esm.mjs",
+ "module": "./dist/index.esm.mjs",
"require": "./dist/index.cjs.js"
}
![image](https://private-user-images.githubusercontent.com/51149996/332597598-d57b6547-0416-46fa-ab3c-4c91556deaeb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0NTYzMTYsIm5iZiI6MTcyMTQ1NjAxNiwicGF0aCI6Ii81MTE0OTk5Ni8zMzI1OTc1OTgtZDU3YjY1NDctMDQxNi00NmZhLWFiM2MtNGM5MTU1NmRlYWViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIwVDA2MTMzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFmZjIwMWU5YTYwY2ZiMjE2MzM5MmNiZTczZGUzMjRiMDU1NDUxMTBlOWU3YzBlMWZiNTE1YTdlZDJmZGYwNjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.cko7HmXIr6l358puNUb_f3GCCyp_j468UStphD9Wa3k)
{
"dependencies": {
"react-hook-form": "file:./react-hook-form",
},
}
I added the above example to the repository.
- git clone https://github.com/Sh031224/react-hook-form-bundle.git
- sh ./prepare.sh && pnpm run dev
from react-hook-form.
https://webpack.js.org/guides/package-exports/#conditions
Because of support in webpack, it seems that module must also be added to the exports field.
also related: https://github.com/orgs/react-hook-form/discussions/3894#discussioncomment-2135181
from react-hook-form.
Related Issues (20)
- issue: useFieldArray cut off null values from array and cause broken indexing next entities HOT 1
- issue: isDirty form state set to true even if i manually reset it
- issue: Zod refine error with objects
- issue: Problem with constraining an optional field HOT 5
- issue: dirtyFiedls type error HOT 1
- issue: SetState after submission results in stale data on render HOT 1
- issue: reset() and keepDirtyValues on dirty fields containing an array always resets the value
- issue: Duplicate fields after deleting. useFieldArray and react-query HOT 6
- issue: useController with array as value does not update useFieldArray linked to same field
- Feature Request: modeling different resolver input and output types HOT 2
- issue: Typo in docstring
- issue: Appending to a field array when there is a default value replaces the original value instead of actually appending
- issue: Type of changes from useFieldArray-Functions are `undefined` HOT 1
- issue: useController should subscribe to exact field name of form's state
- Feat: add a recursive depth limit to path (eager.d.ts) HOT 1
- issue: useFieldArray and Controller mix shows previous value HOT 1
- issue: remaining textarea value after reset HOT 1
- Unable to trigger validation inside of rules
- issue: HOT 2
- issue: useEffect not triggering on value watched with useFieldArray HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-hook-form.