seawind543/react-token-input

Minified React error #321

seawind543 opened this issue · 1 comments

Issue

Will get this runtime error when TokenInput is imported by npm:

Uncaught Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Impact

^1.0.0

Root cause

  • Have multiple instances of React

Solution

  • As list in [1]
    -- Add move react into devDependencies, and add peerDependencies too.
    -- Set externals for production webpack

Reference:

  1. facebook/react#16029 (comment)