Closed SilentFlute closed 3 years ago
@mathieudutour @macintoshhelper any adivces?
Yes, it's possible. Check https://github.com/airbnb/react-sketchapp/tree/master/examples/profile-cards-primitives . You need to use react-primitives, which resolves the necessary components for each platform, using react-native-web to render to web. You can setup hot reloading to web with a react-sketchapp project.
Keep in mind that there will be slight differences in typography rendering on different platforms, there's even a difference between React Native iOS and React Native Android.
25 Sep 2021 06:16:40 ๅฐ้้ไป @.***>:
@mathieudutour[https://github.com/mathieudutour] @macintoshhelper[https://github.com/macintoshhelper] any adivces?
โ You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub[https://github.com/airbnb/react-sketchapp/issues/531#issuecomment-927007635], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABTRZHAYU456HDHUMMIUPADUDVEKRANCNFSM5EVRU4MA]. Triage notifications on the go with GitHub Mobile for iOS[https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675] or Android[https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub]. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAnSURBVHic7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAAPBjRFIAASHKmKkAAAAASUVORK5CYII=###24x24:true###][Tracking image][https://github.com/notifications/beacon/ABTRZHGUYAZOUFXSTREPLQDUDVEKRA5CNFSM5EVRU4MKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG5AQHEY.gif]
thx, and i cloned the airbnb/react-sketchapp
repo
, and into the examples/profile-cards-primitives
, then:
yarn
sketch
and select that pluginsketch
yes! that's no accident, and i noticed that 1st and 3rd pic were broken, and the middle one is a new one, cuz the clothes and background and different from the README file shown ;), but it doesn't matter at all
the important is when i goes yarn web
, i got a error:
Failed to compile with 20 errors.
ERROR in ./~/react-dom/lib/ReactMount.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactMount.js 15:12-38
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactMount.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactMount.js 17:24-62
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/findDOMNode.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/findDOMNode.js 13:24-62
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactDOMUnknownPropertyHook.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactDOMUnknownPropertyHook.js 13:29-72
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactDOMNullInputValuePropHook.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactDOMNullInputValuePropHook.js 11:29-72
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactDOMInvalidARIAHook.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactDOMInvalidARIAHook.js 12:29-72
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactUpdateQueue.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactUpdateQueue.js 13:24-62
@ ./~/react-dom/lib/ReactMount.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactNodeTypes.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactNodeTypes.js 14:12-38
@ ./~/react-dom/lib/getHostComponentFromComposite.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactDebugTool.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactDebugTool.js 14:29-72
@ ./~/react-dom/lib/ReactInstrumentation.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/instantiateReactComponent.js
Module not found: Error: Can't resolve 'react/lib/getNextDebugID' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/instantiateReactComponent.js 18:21-56
@ ./~/react-dom/lib/ReactMount.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactDOMOption.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactDOMOption.js 13:12-38
@ ./~/react-dom/lib/ReactDOMComponent.js
@ ./~/react-dom/lib/ReactDefaultInjection.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactMultiChild.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactMultiChild.js 17:24-62
@ ./~/react-dom/lib/ReactDOMComponent.js
@ ./~/react-dom/lib/ReactDefaultInjection.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactCompositeComponent.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactCompositeComponent.js 14:12-38
@ ./~/react-dom/lib/instantiateReactComponent.js
@ ./~/react-dom/lib/ReactMount.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactCompositeComponent.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactCompositeComponent.js 16:24-62
@ ./~/react-dom/lib/instantiateReactComponent.js
@ ./~/react-dom/lib/ReactMount.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/flattenChildren.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/flattenChildren.js 24:27-70 40:33-76
@ ./~/react-dom/lib/ReactMultiChild.js
@ ./~/react-dom/lib/ReactDOMComponent.js
@ ./~/react-dom/lib/ReactDefaultInjection.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/ReactChildReconciler.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/ReactChildReconciler.js 27:27-70 35:31-74
@ ./~/react-dom/lib/ReactMultiChild.js
@ ./~/react-dom/lib/ReactDOMComponent.js
@ ./~/react-dom/lib/ReactDefaultInjection.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/LinkedValueUtils.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/LinkedValueUtils.js 16:12-38
@ ./~/react-dom/lib/ReactDOMInput.js
@ ./~/react-dom/lib/ReactDOMComponent.js
@ ./~/react-dom/lib/ReactDefaultInjection.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/checkReactTypeSpec.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/checkReactTypeSpec.js 27:27-70 69:37-80
@ ./~/react-dom/lib/ReactCompositeComponent.js
@ ./~/react-dom/lib/instantiateReactComponent.js
@ ./~/react-dom/lib/ReactMount.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-dom/lib/traverseAllChildren.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-dom/lib'
@ ./~/react-dom/lib/traverseAllChildren.js 13:24-62
@ ./~/react-dom/lib/flattenChildren.js
@ ./~/react-dom/lib/ReactMultiChild.js
@ ./~/react-dom/lib/ReactDOMComponent.js
@ ./~/react-dom/lib/ReactDefaultInjection.js
@ ./~/react-dom/lib/ReactDOM.js
@ ./~/react-dom/index.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
ERROR in ./~/react-native-web/dist/modules/ResponderEventPlugin/index.js
Module not found: Error: Can't resolve 'react-dom/unstable-native-dependencies' in '/Users/kunmingcn/Documents/code/react-sketchapp/examples/profile-cards-primitives/node_modules/react-native-web/dist/modules/ResponderEventPlugin'
@ ./~/react-native-web/dist/modules/ResponderEventPlugin/index.js 4:0-88
@ ./~/react-native-web/dist/exports/createElement/index.js
@ ./~/react-native-web/dist/index.js
@ ./~/react-primitives/lib/injection/react-native-web.js
@ ./~/react-primitives/lib/index.js
@ ./~/react-primitives/index.js
@ ./src/components/Profile.js
@ ./src/web.js
@ ./~/nwb/lib/reactRunEntry.js
@ multi ./~/nwb/polyfills.js ./~/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js ./~/nwb/lib/reactRunEntry.js
is this a bug or something?
@macintoshhelper MAYDAY MAYDAY
@mathieudutour hi there, i think i found a bug
i can't figure this issue
out, can't fix it, but i find another way to solve it: i use UmiJS as the scaffold
, and refer to /examples/profile-cards-primitives
, use react-sketchapp
and related pkgs, without nwb
nwb.config.js
, and it worked !!!
sketch
from react
react
from browser
macos: 10.15.7 sketch: 75 node: 14.17.6
hi, i check all the issues out, but couldn't find one which is about how to view the
react-sketchapp
's result from browserreact-sketchapp
is great, it convertreact
code tosketch
, and i am wondering if i can see the result from browser, for example, there is a code:the
basic-setup
example
fromreact-sketchapp
, i can see the result fromsketch
at least: but before in thesketch
, i want to see this result from browser first, just like the normal page development, is that possible? how can i do it? thx