I have displayProjectTable that gets state from reducer projectData and populates itself.

Currently displayProjectTable has a local state that stores focusedRowID. My problem is that I want other components to have the ability to modify the focusedRowID and it's content.

Some examples: -A component tells displayProjectTable to add 1 to focusedRowID (ie. focus on the next row) -A component tells displayProjectTable to set value of row at focusedRowID to "test". Because displayProjectTable gets its state from projectData, that reducer's state will have to be changed at the focusedRowID index.

A possible solution is to store focusedRowID inside of the projectData.js reducer. However, this seems like a bad solution to me. The projectData reducer is responsible for fetching, storing, and saving projectData. Would it really make sense to store a focusedRowID when projectData shouldn't even know what a row is?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.