airbnb/react-sketchapp

Code examples in the demo section are not-editable

anishagg17 opened this issue · 2 comments

I am Anish

| -------------------------------------------------------------------------------------------------

Make the examples editable/toggle

Proposal/Feature-request:

  • Users should be able to observe dynamic changes in rendered-component in examples.
  • Add several toggles such as checkboxes to indicate on/off state of component
  • Code should be editable to observe changes

Hi, you can use npm run render to have live rendering of your components to Sketch when you save a file (watches file changes and automatically builds and runs the plugin in Sketch.

react-sketchapp is built using react-test-renderer, so is more of a static snapshot of your component tree/state (server-side rendering pretty much). It doesn't have access to a React runtime/reconciler for events/async, so true hot reloading isn't currently possible, and you can't have dynamic React state, so checkbox toggles, etc aren't currently possible.

I don't believe Sketch has enough of a dynamic API for this to be a major use-case at the moment.

Yeah I'm going to close this because it's not really actionable: Sketch doesn't support on/off state, it's pretty static