You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
docz-theme-default and docz's package.json has react & react-dom in both dependencies and peerDependencies. It makes all kind of unwanted behavior in monorepo setups. For example:
If you have react & react-dom installed in the parent directory (./) and docz installed on a child directory (./site) directory, it creates a nasty bug. If you use hooks in your application, this error pops up:
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
And it is specifically caused by the point number 1 described in the error message. If you remove the parent directory's node_modules (i.e. ./node_modules) everything works fine.
To Reproduce
mkdir parent && cd parent && npm init
npm install --save-dev react react-dom
mkdir site && cd site && npm init
npm install --save-dev docz docz-theme-default
This will install react & react-dom in ./site/node_modules (which it should not).
Expected behavior
react & react-dom should only be in the peerDependencies
The text was updated successfully, but these errors were encountered:
Bug Report
docz-theme-default
anddocz
'spackage.json
hasreact
&react-dom
in bothdependencies
andpeerDependencies
. It makes all kind of unwanted behavior in monorepo setups. For example:If you have
react
&react-dom
installed in the parent directory (./
) anddocz
installed on a child directory (./site
) directory, it creates a nasty bug. If you use hooks in your application, this error pops up:And it is specifically caused by the point number 1 described in the error message. If you remove the parent directory's
node_modules
(i.e../node_modules
) everything works fine.To Reproduce
mkdir parent && cd parent && npm init
npm install --save-dev react react-dom
mkdir site && cd site && npm init
npm install --save-dev docz docz-theme-default
react
&react-dom
in./site/node_modules
(which it should not).Expected behavior
react
&react-dom
should only be in thepeerDependencies
The text was updated successfully, but these errors were encountered: