Closed dulguun0225 closed 8 years ago
Could you give us more information on this?
As of now we can already detect props change inside a composer function, right? I was wondering if there could be same thing for state, but only read only access to component's state.
React-komposer does not detect props-change, maybe there is a misunderstanding.
Additionally, you never have access from "outside" to a component's state, so that also makes little sense to me. Maybe you can explain what you want to achieve with this 👍
I wanted to shorten this chain "component -> action -> ReactiveDict -> container" into "component -> container".
For example if I wanted to set the ordering
this could be lot shorter if
I think that it wouldn't be a bad practice unless container gets write access to component's state.
I'm not following. Why do you need react-komposer
if you're simply calling setState
? You don't need to use react-komposer
at all. Maybe you'd be better off with a library like recompose
.
Need it to set parameter to subscription.
I guess people don't get it because I'm asking for what doesn't exist in React. Can higher order component read wrapped component's state?
No. You can't read a component's state from outside. And that's a good thing.
With stateless components you "know" everything about your component anyway, because you pass everything as property
I thought if it is just a read access it would not be a bad practice
Is it possible to detect state change of a component in composer function?