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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg1NjkxMzEsIm5iZiI6MTcxODU2ODgzMSwicGF0aCI6Ii81MTE0OTk5Ni8zMzI1OTc1OTgtZDU3YjY1NDctMDQxNi00NmZhLWFiM2MtNGM5MTU1NmRlYWViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE2VDIwMTM1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU3NmI0MTRiNDA4ZWRjODFiN2UzODlmYmI0OGY2OTlmMzczYTA4YTU0MTFlMWI4OWJmNDc4OGE1MDZmYTM3YTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MLwehnSAsCH5EAsDSCP67nkOKKnuj8ETfRfmCzr1sJ4)
{
"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)
- FieldPathByValue not playing nice with PathValue
- issue: `deps` property in `RegisterOptions` should only accept field names
- issue: trigger function / register deps - trigger re-render even if formState isn't updated HOT 2
- issue: `Type instantiation is excessively deep and possibly` with recursive type HOT 2
- issue: Two useFieldArray instances are not able to modify the same array HOT 2
- Incorrect type inference for `UseFormHandleSubmit`
- issue: UseWatch not subscribing to array changes HOT 1
- issue: `isDirty` is always 'true' when the `reactStrictMode` property is enabled in the `next.config.js` config
- issue: setValue with shouldDirty on nested objected throws TypeError
- Validating array inputs based on another field from within the array
- Create reusable form section HOT 3
- issue: Form should not transition to 'isSubmitting' true unless validation has passed HOT 2
- issue: custom validate works onChange even though I set useForm({mode: 'onBlur'}).
- issue: FieldArray append with React Select not working correctly. HOT 1
- issue: Controlled Field Array Controller component does not render latest value with update(index, { ...item, lastName: "World", }); if using spread operator {...item, lastName: "World"} to update an object
- The new website has a security problem which stops me from seeing it HOT 1
- issue: Subscription to isValidating via useController causes quadratic amounts of re-renders on submit HOT 4
- issue: useFieldArray incorrectly treats value of 0 as empty value
- issue: Form-level `disabled` doesn't affect uncontrolled inputs that aren't rendered immediately HOT 1
- development of hookform/core for alternative frameworks HOT 2
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.