sketchbook-js/sketchbook

Make config render function agnostic

haydn opened this issue · 0 comments

haydn commented

Objective

Instead of this:

render: ({ width, height, options: { text } }) => (
  <h1
    style={{
      width,
      height
    }}
  >
    {text}
  </h1>
);

Something like this:

render: ({ node, width, height, options: { text } }) => {
  ReactDOM.render(
    <h1
      style={{
        width,
        height
      }}
    >
      {text}
    </h1>,
    node
  );
};

Rationale

This make is possible to use Sketchbook with any number of component based UI technologies — React, Peact, Vue, Web Components, jQuery UI, htm etc. We should do this before the initial release to avoid the potential pain of upgrading in future releases.