0

I have Redux store reselect tbodyCommand.reducer.js with Redux store with MAKE_TBODY case where I am calling makeTbodyArray() functions with subscriber in it and for() cycle. This stuff is connected with TableBody component (child of Table component) where I am trying to call this props function (makeTbody() that is dispatched like MAKE_TBODY()) and by calling componentDidMount it have only console logs and loads comVal props with array in debug tools in state, but not rendering at all in component (componentWillReceiveProps exists and works but not rendering all coming from props array).

So the main goal is to render comVal props in table on component first load. If i will change something in sandbox / re - type it and save it will re-render it with props correct rendering (but it wan't be formally first - time - app - rendering, so here props coming I guess from prevProps).

https://gvh5n.csb.app/

Zak the Gear
  • 131
  • 2
  • 14

1 Answers1

0

Through a lot of trying and bad code decisions get two answers on this difficult situation. First one is to look on https://github.com/tannerlinsley/react-query react-query library and it's examples. And the variant that I used for me is just to make a promise and setStateAsync function to make state editable in promise from this question Does this.setState return promise in react. Here is my code https://xmzx3.csb.app/ . So the promise makes available in componentDidMount function to re-render component after getting props function results.

Zak the Gear
  • 131
  • 2
  • 14