Fixes the issue when npm package / exported Component uses React import, so webpack resolves it not from global node_modules/react but instead from package directory, which causes Hooks and other parts of React not working properly.
## NPM
npm i docusaurus-plugin-fix-react
## yarn
yarn add docusaurus-plugin-fix-react
## PNPM
pnpm add docusaurus-plugin-fix-react
/** @type {import('@docusaurus/types').Config} */
const config = {
plugins: ["docusaurus-plugin-fix-react"],
// ... rest of the config
}
/** @type {import('@docusaurus/types').Config} */
const config = {
plugins: ["./node_modules/docusaurus-plugin-fix-react/index.js"],
// ... rest of the config
}
# add next line to your .npmrc file
node-linker=hoisted
MIT © Patryk Jaworski