Skip to content

publish a component written by hooks to npm, but report Minified React error #321 #17014

@lizhongzhen11

Description

@lizhongzhen11

Do you want to request a feature or report a bug?
no.
What is the current behavior?
look this: react-week-time-range-picker.

This is a component written by react hooks. I run it normal when i develop it. However, when i npm install react-week-time-range-picker to test , the page report 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.

I look for the solution almost two days, but i failed.

  1. My version is no problem
  2. I think the hooks call is correct
  3. I doubt it may be the third cause in the official documents,but i test it with official documents code, it print true。

Now, i am muddled.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

What is the expected behavior?
I hope who can help me

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

{
  "react": "^16.10.2",
  "react-dom": "^16.10.2"
}

chrome 77.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions