Open
Description
It'd be great to support react-native!
Use case: web-based react-native designer, render the results (view-only) in react-native.
View-only mode (<Editor enabled={false}>
) doesn't actually depend on anything dom-related, so it seems easy to make it work under react-native.
I tried it as a proof-of-concept, and it seems that there are only 2 things that needs to be changed:
getRandomId
should usenanoid/non-secure
('nanoid' doesn't work in react-native)RenderIndicator
should importreact-dom
conditionally. Something like
const isReactNative =
typeof window !== 'undefined' &&
window.navigator &&
window.navigator.product &&
window.navigator.product === 'ReactNative';
const ReactDOM = !isReactNative ? require('react-dom') : null;
And that's it! After only these two changes it works on React-Native!
I could provide a PR if you are ok with the idea :)
Metadata
Metadata
Assignees
Labels
No labels