MainframeOS / react-json-renderer

MIT License
37 stars 3 forks source link

Dump component map from convert #1

Open nelix opened 7 years ago

nelix commented 7 years ago

Would be nice to be able to have hydrate and dehydrate callbacks for custom components/classes on convert/render (render basically already accepts a map, might be nice if it was a Map()).

Use case: I'm working on something that allows you to call reduce on a page to decorate/add ui traits to an existing webpage, so a chrome extension could for example add resize handlers to all components or something.

I can prolly submit a PR, but I figured I'd ask on how you think it should look/be implemented first.

PaulLeCam commented 6 years ago

Hi, sorry for the late reply, I haven't been focusing on this lib since it got implemented in our project.

I'm not sure I fully get your use case but from what I understand, maybe adding a renderComponent(type: string, props: Object) => ?{type: string, props: Object} option for example could be used to customize the output?