ovidiuch / react-component-playground

Minimal frame for loading and testing React components in isolation.
MIT License
76 stars 16 forks source link

Add support for objects with toJSON methods #35

Closed svieira closed 6 years ago

svieira commented 8 years ago

Add support for objects which claim to know how to serialize themselves.

This allows these sorts of properties to at least show up in the editor, even if they cannot be edited without a corresponding hook in onFixtureChange.

ovidiu-chereches-hs commented 8 years ago

This allows these sorts of properties to at least show up in the editor, even if they cannot be edited without a corresponding hook in onFixtureChange.

Wouldn't this normally break your component after the first update? If you component relies on some method from that class instance, it will.

svieira commented 8 years ago

Yes, it will - but I'm trying to figure out a good way to provide a hook for that in onFixtureChange - right now I'm just overriding it completely. I figured half a loaf was better than none :-) If you want to wait until we also have a hook for deserialization, I'm fine with that too.