question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automation set up with `Yarn link` and Yarn link `react-hook-form`

See original GitHub issue

I am trying to set up automation env for react-hook-form and having an app running which references back to the source code in the src folder.

I have used yarn link at /src folder and then run yarn link react-hook-form at /app folder. however, when I start the app, I am getting this issue:

image

there is definitely no duplicated react.

wondering if anyone has experience or know how to fix this issue. PR welcome 😃 ❤️

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
barrymaycommented, Jul 31, 2019

ah… I know this one… (ran into it myself a bunch of times)

Do what you did… plus:

  1. Go into your node_modules/react folder within the react-hook-form codebase
  2. Run yarn link
  3. Go to your app where you’re testing, and run yarn link react

The problem is that with hooks, you need to ensure the exact same react instance you built react-hook-form with is the one you’re testing with. It’s only necessary when using yarn link across projects, because the builds can be slightly different.

1reaction
bluebill1049commented, Jul 31, 2019

OMG! @barrymay you are the GOD. It’s working! thank you so much again ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hooks don't work with yarn link · Issue #14257 · facebook/react
When developing an external library locally and using yarn link to link the library to a local react app the "hooks can only...
Read more >
Yarn link React component library to app results in "Invalid ...
reactjs - Yarn link React component library to app results in "Invalid Hook call" error (multiple React instances) - Stack Overflow. Stack ...
Read more >
react-hook-form | Yarn - Package Manager
Performant, flexible and extensible forms library for React Hooks. react, hooks, form ... React Hook Form Logo - React hook custom hook for...
Read more >
Building Scalable Front-end With Lerna, YARN And React In ...
Build a scalable front-end platform using Lerna, Yarn and React in just 60 minutes.
Read more >
Get Started | React Hook Form - Simple React forms validation
One of the key concepts in React Hook Form is to register your component into the hook. This will make its value available...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found