5

I'm working on a ReactJS web app. I made a change to code that was working and now I get an error:

Error: Minified React error #301

I can revert the code to get it working again but I'm not sure what I'm doing wrong to get this error.

NOTE: The last thing I added was:

const [openDialog, setOpenDialog] = useState(false);

So perhaps I can't use this...

Does React have a list of error codes and explanations?

Searching for answers:

  • Searched React error codes and explanations. Nothing that helped.
Community
  • 1
  • 1
PatS
  • 8,833
  • 12
  • 57
  • 100
  • 1
    It looks like your developing with the minified version of React, you would have meaningful error messages and stack traces with the development version. Here's [how to toggle the React version](https://stackoverflow.com/q/22118915/1218980) you use. – Emile Bergeron Oct 30 '19 at 20:06

1 Answers1

14

Does React have a list of error codes and explanations?

There should be a URL included in the error that points you to a more complete description. The pattern is:

https://reactjs.org/docs/error-decoder.html?invariant=###

So I plugged in 301 and got the following https://reactjs.org/docs/error-decoder.html?invariant=301 answer...

Too many re-renders. React limits the number of renders to prevent an infinite loop.

PatS
  • 8,833
  • 12
  • 57
  • 100