fix(ui-components): react in regular dependencies causes duplicate hook errors in consumer apps
Maintainers usually reply within 2 days
Nobody has claimed this yet.
- #9176 by @alexicum — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- build-system, frontend
Research direction
Start with packages/ui-components/package.json and inspect its dependencies, peerDependencies, and devDependencies. Move React as described, use the named catalog entry with the ^19.0.0 range, and verify that the published package accepts a consumer-installed React 19 without creating a duplicate copy.
Written by the indexing model from the issue text.
Description
Description
Currently, react is listed under dependencies in packages/ui-components/package.json.
While it works fine inside the monorepo, it breaks consumer apps that use a different sub-version of React 19. Package managers install a duplicate copy of React , leading to the runtime error:
Invalid hook call. You might have more than one copy of React in the same app.
Proposed Solution
Move react from dependencies to peerDependencies (and duplicate in devDependencies for local workspace builds).
We should use a named pnpm catalog (catalog:peer-react19 with a ^19.0.0 range) so the published package accepts any React 19 version installed by the consumer app.
- Dominant language
- TypeScript
- Stars
- 6.9k
- Forks
- 6.5k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 48
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nodejs/nodejs.org
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
nodejs/nodejs.org#9248 ·
Maintainers usually reply within 2 days
-
ESLint import-x/order config doesn't match documented import organizationPossibly taken @Devehab claimed this 3 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
nodejs/nodejs.org#9225 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nodejs/nodejs.org#9098 · 4 comments · 1 reaction ·
Maintainers usually reply within 2 days
-
Sidebar scroll position resets on navigation, active item can be off-screenPossibly taken @codebyanas claimed this 50 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
nodejs/nodejs.org#8828 · 4 comments ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 56/100
nodejs/nodejs.org#9239 · 1 comment · 2 reactions ·
Maintainers usually reply within 2 days
All issues in nodejs/nodejs.org
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:web p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Lets-Parley/Parley#912 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wealthfolio/wealthfolio#2376 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
be-BOP-io-SA/be-BOP#2817 ·
Maintainers usually reply within 5 days
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
sno-ai/sno-station#149 · 1 comment ·
Maintainers usually reply within 1 day