draftbit / rescript-storybook

Storybook bindings for Rescript
80 stars 21 forks source link

Any plans to add support for Controls? #23

Open BlueHotDog opened 3 years ago

BlueHotDog commented 3 years ago

Hey, was wondering if you've any thoughts on adding support for Controls(https://github.com/storybookjs/storybook/blob/next/addons/controls/README.md#writing-stories)

davesnx commented 3 years ago

Hey @BlueHotDog

Their API isn't something doable in Reason that translates one-to-one, the CSF module relies hardly on JavaScript type weakness which is almost impossible to bind in Reason:

We might get far from doing some bridge code: instead of doing straight bindings, we could make a functor out of CSF define something alike.

module type CSF = {
  type props;
  let make: props => React.element;
};

I only explore this path theoretically, which makes things more abstract. If there's a lot of need for Controls I might spend some time trying.

Let me know if make sense, Thanks for opening an issue!