-
Notifications
You must be signed in to change notification settings - Fork 23
React Native Compatibility #102
Comments
I think the only solution would be to publish react-native specific versions along with our normal releases. |
Slightly crazy suggestion - Could we make use of peer dependencies here? ie, create a new npm module |
Looking quickly through the source, I think @jacobdfriedmann is right that the dependency on |
I finally got a chance do some playing around with this tonight. @jacobdfriedmann, do you recall what the original problem was when you created this issue? I ask because I was actually able to get FluxThis working with React Native without any real tinkering at all. Things I tested: APIActionCreator with a request to a NodeJS endpoint that I quickly whipped up, plain old ActionCreator, and ImmutableStore. They all essentially "just worked" (even the validation of payloadTypes; see the second screenshot below). One possible caveat is that I required the pre-built version of FluxThis; not sure how things would go with the uncompiled version. EDIT to add: the validation failure in the second screenshot is right, even though the payloadType is |
You're right...this isn't a problem if you use the prebuilt version, which comes packaged with the PropTypes module. I was requiring the source files. I guess there is no real need for me to do that. I'll close this. |
This is also worth noting. It sounds like you might be able to require the source files without issue very soon. facebook/react-native#2985 |
Was playing with react native recently and attempted to use fluxthis because I like it. There are only a couple things (one important one) that would need to be changed in order to make it compatible. I even think the APIActionCreators will work because react-native polyfills xhr. However,
ActionCreator
pulls inreact/lib/ReactPropTypes
for payloadType validation. This obviously won't work in a react native project which would need to require something likerequire('react-native').PropTypes
instead.Not sure if there is a good way (or a convention) to have this dual peer dependency on react OR react-native, but it seems like there should be an easy way to achieve this. Just thought I'd open it up to conversation.
The text was updated successfully, but these errors were encountered: