1.0.7 • Published 4 months ago

docusaurus-plugin-fix-react v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

docusaurus-plugin-fix-react

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.

Installation:

## NPM
npm i docusaurus-plugin-fix-react
## yarn
yarn add docusaurus-plugin-fix-react
## PNPM
pnpm add docusaurus-plugin-fix-react

Add to your docusaurus.config.js:

/** @type {import('@docusaurus/types').Config} */
const config = {
plugins: ["docusaurus-plugin-fix-react"],
// ... rest of the config
}

~ or, alternatively:

/** @type {import('@docusaurus/types').Config} */
const config = {
plugins: ["./node_modules/docusaurus-plugin-fix-react/index.js"],
// ... rest of the config
}

If you use PNPM and @type errors appear this may help:

# add next line to your .npmrc file
node-linker=hoisted

License

MIT © Patryk Jaworski

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago