Mobdux: Combining the good parts of MobX and Redux – Cameron Fletcher – Medium

Mobdux: combining the good parts of MobX and Redux  #ReactJS #Redux #Mob

  • In MobX it is easy to structure your stores in a tree-like manner so that at any point you can view the entire state of your application.
  • Additionally, by using MobX in strict mode, you are forced to make any mutations to your state in actions.
  • The combination of a single store, strict mode, and the excellent mobx-react-devtools help give back some of the predictability and traceability of Redux.One of the ways the libraries significantly diverge however, is when connecting your state to your components.
  • Redux on the other hand, recommends the smart component / dumb component pairing so that each component (regardless of where it sits in the hierarchy) can look up everything it needs to render itself.I prefer the Redux approach for a number of reasons:Easier to move things around in your component…
  • Also, we can remove all knowledge of MobX from our dumb components by encapsulating all of this logic in our smart component wrapper, removing the need for the observer decorator entirely.

MobX and Redux give you two opposing ways to manage your state effectively in a React application. As an experiment I attempted to merge the good parts of both approaches, and ended up with a new…
Continue reading “Mobdux: Combining the good parts of MobX and Redux – Cameron Fletcher – Medium”

Learn modern JavaScript from 7 expert authors – EdgeCoders

  • Learn modern JavaScript from 7 expert authors40 hours of video, 1000+ pages of guidance, 7 authors, the best ways to build modern JavaScript apps is hard.
  • Whether it’s web or native, it doesn’t matter.
  • What’s Redux again?Where do you even begin?If you’re like most, you start at a random spot that piques your interest.
  • Then you read a bunch of random blogs and Stack Overflow answers and Readme files on GitHub and voilĂĄ, 10 years later, you’re a pro.😅That’s why this holiday season I got together with 6 other expert JavaScript authors and designed a coherent learning journey.
  • Self-paced learning from 7 expert authors who will answer your email if you have a question.You start with the basics of modern JavaScript, continue with React and Redux, learn all about the modern build tools, follow it up with native apps, build some shiny examples that would make your mom…

Learning the best ways to build modern JavaScript apps is hard. Whether it’s web or native, it doesn’t matter. There’s just so much you have to learn. ES6, ES6+, 2016/2017. Why do people say…
Continue reading “Learn modern JavaScript from 7 expert authors – EdgeCoders”

Mobdux: Combining the good parts of MobX and Redux – Cameron Fletcher – Medium

  • In MobX it is easy to structure your stores in a tree-like manner so that at any point you can view the entire state of your application.
  • Additionally, by using MobX in strict mode, you are forced to make any mutations to your state in actions.
  • The combination of a single store, strict mode, and the excellent mobx-react-devtools help give back some of the predictability and traceability of Redux.One of the ways the libraries significantly diverge however, is when connecting your state to your components.
  • Redux on the other hand, recommends the smart component / dumb component pairing so that each component (regardless of where it sits in the hierarchy) can look up everything it needs to render itself.I prefer the Redux approach for a number of reasons:Easier to move things around in your component hierarchy.No pass-through props, where a component forwards props to its children despite not needing them for its own rendering.Easier to test / re-use / write storybook stories for the dumb components that are only interested in rendering.Dumb components are completely decoupled from Redux, allowing for re-usability if the consumer decides to change state frameworks (to MobX or relay for example).
  • Also, we can remove all knowledge of MobX from our dumb components by encapsulating all of this logic in our smart component wrapper, removing the need for the observer decorator entirely.

MobX and Redux give you two opposing ways to manage your state effectively in a React application. As an experiment I attempted to merge the good parts of both approaches, and ended up with a new…
Continue reading “Mobdux: Combining the good parts of MobX and Redux – Cameron Fletcher – Medium”

“Thinking in React” — A paradox statement – Sebastian K – Medium

Thinking in #ReactJS: A paradox statement  #JavaScript

  • But before we investigate further, let’s take a step back and think about the three basic principles of React components.React Components — Three Basic PrinciplesOther devs and I have identified three principles which should be the foundation for all React components:A component should be a pure function which transforms data into a user interface.
  • But what if multiple dumb components rely on the same data and should display updates to that data synchronously?Data Flow in ReactA simple React component treeLet’s take the component tree above as an example to study the way we move data around inside a React application.
  • This means that we have created a coupling between the target of our data (C and D) and all the components between these targets and their common state container (the root component).
  • There is a solution for this problem though, and its name is Context.Context to the Rescue!Context allows us to transform the root component into a context provider, which would then provide data for other components further down the tree without having to pass down this data explicitly the whole way to the target components.
  • You can read more about this in this article of MobX creator Michel Weststrate.In addition, the React documentation states that Context is an unstable API and recommends using a simple Provider component at the top of your hierarchy and using Higher Order Components to create the consumers which will then pass down the data to the actually consuming dumb components they wrap.

Managing state in React is a solved problem. Or is it? Dozens of state libraries exist, but why can we not simply use the tools React itself provides us?
Continue reading ““Thinking in React” — A paradox statement – Sebastian K – Medium”

React and Flux in Production Best Practices — Medium

#ReactJS and Flux in production best practices:

  • If not, then we walk the component hierarchy, up to the Smart component and eventually to the Smart component’s state .
  • Smart components in our pattern use setState() and return Dumb components from the render() function by using the state property.
  • Smart components are named so because they’re the components permitted to talk to Stores and Action Creators in our Flux pattern.
  • Container components render little real DOM; they mainly return one or more Smart components in their render() function.
  • Dumb components are where we render the majority of our DOM and define CSS for a component.

Read the full article, click here.


@ReactiveConf: “#ReactJS and Flux in production best practices:”


It’s Alex again, back to talk about the tips and best practices we’ve learned in Delve over the past ~18 months of shipping React and Flux…


React and Flux in Production Best Practices — Medium