Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Failed prop type: Invalid prop children of type array supplied to Provider, expected a single ReactElement. #1998

Closed
isAlmogK opened this issue Jul 9, 2017 · 2 comments

Comments

@isAlmogK
Copy link

isAlmogK commented Jul 9, 2017

Using V4 with Redux getting the following error "Failed prop type: Invalid prop children of type array supplied to Provider, expected a single ReactElement."

The code is based off the doc/example

const ConnectedRouter = connect()(Router);

render() {
        return (
            <Provider store={store} >
                /* Breaking changes with react-native-router-flux all
                 routes need to be here and not in a separate routing file, check back for support.
                 */
                <ConnectedRouter>
                    <Scene key="root">
                        <Scene key="login" component={Login} initial={true} />
                        <Scene key="ResetPassword" component={ResetPassword} />
                    </Scene>
                </ConnectedRouter>
            </Provider>
        );
    }
}
@aksonov
Copy link
Owner

aksonov commented Jul 10, 2017

Nice, try to remove that comment about 'Breaking changes'! I've just added redux to Example without any problem, but reproduce your issue only after adding comment as child for Provider. Weird redux issue.

P.S. You may want to switch MobX ;)

@aksonov aksonov closed this as completed Jul 10, 2017
@isAlmogK
Copy link
Author

That's crazy never even thought about that. MobX looks good but I need redux they have redux offline which I need thanks for the quick support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants