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

Using Wrapped Provider with React.createElement throws TypeError: Object [object Object] has no method 'toUpperCase' #633

Closed
kevzettler opened this issue Aug 27, 2015 · 1 comment

Comments

@kevzettler
Copy link

Following the example here
https://github.com/rackt/react-redux#react-router-013
I'm using a wrapper provider on my React Router handler

 <Provider store={store}>
     {() => <Handler {...ReactProps} routerState={routerState} />}
</Provider>

If I pass this to React.renderToString it renders correctly.

if I pass it to React.createElement it throws an error
TypeError: Object [object Object] has no method 'toUpperCase'

site-0 (err): 2015-08-27 01:32 +00:00: TypeError: Object [object Object] has no method 'toUpperCase'
site-0 (err):     at autoGenerateWrapperClass (/opt/site/node_modules/react/lib/ReactDefaultInjection.js:53:19)
site-0 (err):     at Object.getComponentClassForElement (/opt/site/node_modules/react/lib/ReactNativeComponent.js:59:49)
site-0 (err):     at validatePropTypes (/opt/site/node_modules/react/lib/ReactElementValidator.js:361:45)
site-0 (err):     at Object.ReactElementValidator.createElement (/opt/site/node_modules/react/lib/ReactElementValidator.js:408:5)

I'm using some 3rd party middleware that passes the wrapped handler to
React.renderToString(React.createElement())

I suspect this is because React is trying to get a type for the anonymous function {() => }

Do I have to use an anonymous function here? can I wrap it in some other component or something?

@kevzettler
Copy link
Author

opened in wrong repo moved to here: reduxjs/react-redux#74

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

1 participant