This package is dependent of React, but its package.json does not mention React anywhere. Instead, the code uses a dynamic CommonJS require() in order to be able to show an error when React is not installed.
This may be solved with package.json's peerDependencies, which also allows us to specify which React version the code is compatible with. Here is an in-depth explanation from the node.js blog:
This package is dependent of React, but its
package.json
does not mention React anywhere. Instead, the code uses a dynamic CommonJSrequire()
in order to be able to show an error when React is not installed.This may be solved with
package.json
'speerDependencies
, which also allows us to specify which React version the code is compatible with. Here is an in-depth explanation from the node.js blog:https://nodejs.org/en/blog/npm/peer-dependencies
I've personally never used it before and there might be some pitfalls, so this change will need to be thoroughtly evaluated first.