Presentational and Container Components – Medium

Presentational and Container #Components:  by @dan_abramov #reactjs

  • Both presentational and container components can contain other presentational or container components just fine.
  • ** In an earlier version of this article I claimed that presentational components should only contain other presentational components.
  • When you notice that some components don’t use the props they receive but merely forward them down and you have to rewire all those intermediate components any time the children need more data, it’s a good time to introduce some container components.
  • Presentational components can be stateful, and containers can be stateless too.
  • Functional components are simpler to define but they lack certain features currently available only to class components.

You’ll find your components much easier to reuse and reason about if you divide them into two categories.
Continue reading “Presentational and Container Components – Medium”

React/JavaScript Office Hours

  • Pattern libraries are a great tool for building sustainable design systems on the web.
  • In the talk Ken will detail his year in open source at Formidable.
  • Alex is an author of Radium, an organizer of CascadiaJS, and sometimes gets emotional about pattern libraries.
  • Let’s look at some ways to push pattern libraries to the next level, turning them into design tools, API documentation, prototyping interfaces, and beyond.
  • Start a Meetup Group Start a Meetup Group

Join us to celebrate the opening of our London location with React, React Native and web development related talks, food and drink.
• 6:30 Doors open for food and beverage
• 7:00 Kickoff from
Continue reading “React/JavaScript Office Hours”

A Visual Guide to State in React

A Visual Guide to State in #React  #reactjs #js #jsx #javascript #webdev

  • React re-renders the app in response to the state change
  • React knows when state has changed because you tell it explicitly , by calling this.setState from inside a component.
  • React maintains state as an object
  • If you are using Redux, you actually will have one big state object that describes the entire app.
  • The point remains: change the state object to change how the app looks.

React’s “state” is one of the more difficult concepts to learn. Not just what to put in state, but what it actually is and what it’s for. And also how Redux is related to React state.
Continue reading “A Visual Guide to State in React”

Introducing Chain React — The React Native Conference

The #reactnative #conference is coming soon, @ChainReactConf!  #chainreact2017 @ReactJS_News

  • We at Infinite Red have been working with Facebook’s React Developer Relations team to put together a great conference.
  • Infinite Red is excited to announce Chain React – The React Native Conference !
  • Chain React will be a two-day, single track conference hosted in Portland, Oregon in summer 2017.
  • If you’re in Europe or able to travel there, check out React Native EU hosted by our friends at callstack .
  • Software engineer [currently Elixir/Phoenix & React Native, dabbling in Elm], Lutheran, husband & dad to 4.

A two day, one-track React Native conference in Portland Summer 2017
Continue reading “Introducing Chain React — The React Native Conference”

Using Saga To Accumulate And Deduplicate Redux Actions

  • GET /users/789 GET /users/456 GET /users/735 …
  • keys ( ids [ resource ]) }, }); delete ids [ resource ]; delete tasks [ resource ]; } function * accumulate ({ payload }) { const { id , resource } = payload ; if ( !
  • GET /posts HTTP 1.1 OK [ { id: 93, title: ‘seatae soluta recusante’, author_id: 789, }, { id: 124, title: ‘commodi ulam sint et’, author_id: 456 }, { id: 125, title: ‘consequatur id enim sint’, author_id: 735 }, …
  • The accumulate() function adds the id from the payload to an ids object that’s in the middleware closure, with a trick to deduplicate ids.
  • Redux Saga allowed us to keep the component logic simple (each component dispatches one single action), and to add sophisticated side effects in the controller part of the application.

Published on 18 October 2016

by François Zaninotto

with tags ReactJS admin-on-rest Redux

Continue reading “Using Saga To Accumulate And Deduplicate Redux Actions”

How to connect MobX with a react-router?

just blogged: how to use #mobx with #reactrouter -   #reactjs #javascript

  • Thanks to the Provider component we can pass the stores object to all the child components.
  • Even if the ChildComponent component has its own children, it shouldn’t pass the whole store into them.
  • In the post about Redux I told you about the connect function and the Provider component.
  • Redux’s connect function and Provider component
  • The way, the React component attached to the route has the store available.

The second article about MobX. This time I will show you two ways of how to connect MobX with a react-router: the Redux way and by importing stores.
Continue reading “How to connect MobX with a react-router?”

How to structure real world Redux/React application – Medium

  • I decided to move the tests into the src/app folder so that they are close to the source.
  • It’s quite easy to see this coming because the file nature will always remain the same but features and data domains grow in real world applications .
  • -app/ – data/ – artifacts/ ArtifactReducer.js ArtifactActions.js ArtifactSelectors.js – calls/ CallsReducer.js CallsActions.js CallsSelectors.js – filters/ …
  • ./data/calls/CallReducer.js’; import * as CallActions from ‘.
  • A better way is to encapsulate the data domain by creating an index.js that exports the internal files of this module.

Recently I was rewriting in Redux/React the web application of Flow, a tool to help developers better understand the structure and the…
Continue reading “How to structure real world Redux/React application – Medium”