News for hackers. Stuff that matters.
Re:Ask HN: Why was React Native recommended to me? Not seein... by JaRail on Saturday March 10, 2018 @04:06PM (#16560156)
Also, if you want to focus on how components in React get their data, that's pretty simple. They just subscribe to it.

If you wanted to render a list of accounts, you could have a couple levels.

At the top, you have an account lists component. It gets a list of accountIds from a global data store (in redux). Then it outputs something like this:

  <List>
    <Account id="1" />
    <Account id="2" />
  </List
The Account components then pull info from Redux about whatever they need to render whatever account they're responsible for.

Each component registers a listener/callback with Redux when its first instantiated. So if the balance of an account changes, it's listening for that change. The change triggers your callback, that triggers a fresh render(). Then the next render() pass pulls the updated account balance with its next pass, etc.

Re:Ask HN: Why was React Native recommended to me? Not seein... by mkirklions on Saturday March 10, 2018 @07:46PM (#16561008)
redux is going to solve my problems, very excited to get this tip.