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

RN 0.38.0 causes issues with createReactNativeComponentClass (again) #188

Closed
rogchap opened this issue Nov 23, 2016 · 7 comments
Closed

Comments

@rogchap
Copy link

rogchap commented Nov 23, 2016

RN 0.38.0 has a peer-dependancy of react@~15.4.0-rc.4 which removes createReactNativeComponentClass from react/lib/createReactNativeComponentClass

Not sure if this is the correct fix but I solved by updating references to react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass

@farwayer
Copy link

I think using requireNativeComponent() is more correct way. It is public API.

@kelset
Copy link

kelset commented Nov 24, 2016

Thanks for the workaround @rogchap.
It took me a bit to clearly understand how to implement it, so for the noobs like me, basically it means to go in /node_modules/react-native-svg/elements and in all the *.js files where the line:

import createReactNativeComponentClass from 'react/lib/createReactNativeComponentClass';

is presented substitute it with:

import createReactNativeComponentClass from 'react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass';

That said, @farwayer with using requireNativeComponent() you mean that all the elements using createReactNativeComponentClass should be modified to be similar to Svg.js?

@farwayer
Copy link

@kelset Yes, this component was broken several times already because of using internal createReactNativeComponentClass().
But requireNativeComponent() automatically adds RCTView props to validAttributes. This may be a problem. @magicismight ?

@neiker
Copy link

neiker commented Nov 25, 2016

This is ready to be merged?

@Kerumen
Copy link

Kerumen commented Nov 25, 2016

@pablocarrillo Maybe you forgot to create the PR?

@pablocarrillo
Copy link
Contributor

PR is now submitted #193. Sorry forgot to send after testing in our app.

@AlbertBrand
Copy link
Contributor

My guess is that this change won't be backwards compatible for RN 0.37 and lower.

janicduplessis pushed a commit to janicduplessis/react-native-svg that referenced this issue Nov 27, 2016
magicismight added a commit that referenced this issue Nov 29, 2016
…ntClass

Fixes #188 in the master repo by replacing the path in the import with the new path
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

7 participants