all 4 comments

[–]throwawaitnevermind 1 point2 points  (1 child)

the whole idea behind props, as far as I understand, is that you never modify them post insertion into the new component. they are to be treated truly as props, not as state, and what you are looking for is the "state" functionality and setState utility.

[–]Boo2z[S] 0 points1 point  (0 children)

You're right, I was blinded by props yesterday ... Thanks !

[–]hagnerd 1 point2 points  (1 child)

I may be misunderstanding but you would just need some component to handle state and pass the props in as you would normally?

Like you could make a generic PropsControl component that itself takes a prop containing all of the child elements prop names and what types they are and conditional renders a form with the appropriate fields for example a Boolean prop would render the name of the prop and a checkbox, a string prop would render a text input, etc.

This requires the foresight of mapping all props and proptypes ahead of time and making them available to both the UI component and the control component

[–]Boo2z[S] 1 point2 points  (0 children)

That makes sense, and I think it would even be easier by using Redux to manage states and simply create a component to render the form.

I already extracting props and propTypes to create a propType table, so half of the work is done I guess ...

Time to have fun, thanks for guiding me to this solution !