Shijin TR
Shijin TR

Reputation: 7788

Invariant Violation : Element type is invalid - React Native

I have the bellow code in my App.js in my react native application.

import React from 'react';
import Provider from 'react-redux';
import {Text} from 'react-native';

const App: () => React$Node = () => {
  return (
    <Provider>
    <Text>hello</Text>
    </Provider>
  );
};
export default App;

It is not working and throws an error like as follows,

enter image description here

Upvotes: 2

Views: 40

Answers (1)

Yoel
Yoel

Reputation: 7985

change

import Provider from 'react-redux';

to

import {Provider} from 'react-redux';

After this, dont forget pass the store as a property to provider

 <Provider store={store}>
    <App />
 </Provider>

Upvotes: 3

Related Questions