A
A
Arseniy Solovey2021-06-21 20:01:59
React
Arseniy Solovey, 2021-06-21 20:01:59

What's wrong with React?

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

7 | let state = store.getState()
   8 | 
>  9 | ReactDOM.render(
  10 |   <React.StrictMode>
  11 |     <React.Provider state={state}>
  12 |       <App />

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
ReactLover, 2021-06-22
@asoloveii

The React.Provider component doesn't exist, where did you get it from? This is the exported type.

I
Igor Timoshenkov, 2021-06-22
@t1gor

If this is translated literally:

Error: Element type is invalid: Expected string (for built-in components) or class/function (for composite components), but received: undefined. Most likely, you forgot to export your component from the file it is defined in, or you may have confused the default import with the named import.

And to fix it, you can try the following:
  • disable `React.StrictMode` (remove corresponding tag or comment out)
  • check `export` of all your components

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question