SlideShare a Scribd company logo
Manage React state with MobX
Simple, scalable state management
Presented by Asif Nawaz
What is MobX?
• MobX is a super simple state management library. MobX is not a
React thing, this is a standalone library, but it’s very popular with
React JS. People are very comfortable with this combination.
React Has State, why on earth we need MobX?
WHY?
Look at this component tree
State in React JS is pretty component
specific thing. It’s hard to pass it to
another component and its pretty
complex to pass it to a component
when it’s bit far away.
Imagine we need to change a of B5
component from A3 component.
Here MobX is to rescue you
• You can create data store with observable array, object etc. with
MobX
• Import it to multiple components
• Share the data between components in an organize way.
• No need to pass props through many components to reach the
grand child.
Installation for “create-react-app”
• The Library: npm install mobx –save
• React bindings: npm install mobx-react --save
Oh! We need decorator support!
• npm install babel-plugin-transform-decorators-legacy –-save-dev
• npm run eject
• Add this babel plugin in webpack config file,
webpack.config.dev.js and webpack.config.prod.js
It has 4 features
• Observable
• Observer
• Computed
• Autorun
A MobX Store
Pass it to a component
Use it!
autorun
• Autorun is for observing multiple variable and do something when
their value change.
DevTools
• Install it: npm install --save-dev mobx-react-devtools
• Import and use in a parent level component like this
Links
• mobx.js.org
• mobx.js.org/getting-started.html
• github.com/mobxjs/mobx-react-devtools
• github.com/foxhound87/mobx-react-form
• Presentation would be found here
https://www.slideshare.net/secret/36hXs93Ofz06yZ
Questions are welcome
Asif Nawaz A.K.A. asifsaho
• Twitter @asifsaho
• Facebook fb.me/asifsaho.me
• Email: info@asifsaho.me

More Related Content

PDF
React state management with Redux and MobX
PPTX
Rethinking Best Practices
PDF
Redux essentials
PDF
OpenSource & InnerSource pour accélérer les développements
PDF
Redux toolkit
PPT
React js
PPT
Django
PDF
Introduction à React
React state management with Redux and MobX
Rethinking Best Practices
Redux essentials
OpenSource & InnerSource pour accélérer les développements
Redux toolkit
React js
Django
Introduction à React

What's hot (20)

PDF
Redux Toolkit - Quick Intro - 2022
PDF
ADRという考えを取り入れてみて
PDF
PPTX
React + Redux Introduction
PDF
State Management in Angular/React
PPTX
React hooks
PDF
An Introduction to Redux
PPTX
Clean code: SOLID
PPTX
React js for beginners
PDF
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
PDF
Angular state Management-NgRx
PDF
How To Become Better Engineer
PPTX
정해균 포트폴리오
PDF
진민완 포트폴리오
PDF
Android Developer JeongJaeyun
PDF
Redux Sagas - React Alicante
PPTX
Lecture 1 Introduction to React Native.pptx
PDF
Redux Saga - Under the hood
PDF
Painless JavaScript Testing with Jest
Redux Toolkit - Quick Intro - 2022
ADRという考えを取り入れてみて
React + Redux Introduction
State Management in Angular/React
React hooks
An Introduction to Redux
Clean code: SOLID
React js for beginners
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
Angular state Management-NgRx
How To Become Better Engineer
정해균 포트폴리오
진민완 포트폴리오
Android Developer JeongJaeyun
Redux Sagas - React Alicante
Lecture 1 Introduction to React Native.pptx
Redux Saga - Under the hood
Painless JavaScript Testing with Jest
Ad

Similar to Manage react state with MobX (20)

PPTX
Academy PRO: Advanced React Ecosystem. MobX
PDF
Introduction to React with MobX
PDF
Smarter State Management with MobX State Tree
PDF
Mobx for Dummies - Yauheni Nikanowich - React Warsaw #5
PPTX
MobX intro
PDF
MobX for dummies
PDF
Mob x in react
PPTX
Mob x
PDF
MobX & MST: 편안한 State Management
PDF
Making react part of something greater
PPTX
Introduction to React and MobX
PDF
React and MobX: A Truly Reactive App
PDF
A React Journey
PDF
Corso su ReactJS
PDF
The Problems with Redux: Are MobX and Realm going to put and end to it?
PDF
Mobx State Tree - Opinionated State Management
PPTX
Mukesh sharma
PDF
Mobx Internals
PDF
Григорий Шехет "Treasure hunt in the land of Reactive frameworks"
Academy PRO: Advanced React Ecosystem. MobX
Introduction to React with MobX
Smarter State Management with MobX State Tree
Mobx for Dummies - Yauheni Nikanowich - React Warsaw #5
MobX intro
MobX for dummies
Mob x in react
Mob x
MobX & MST: 편안한 State Management
Making react part of something greater
Introduction to React and MobX
React and MobX: A Truly Reactive App
A React Journey
Corso su ReactJS
The Problems with Redux: Are MobX and Realm going to put and end to it?
Mobx State Tree - Opinionated State Management
Mukesh sharma
Mobx Internals
Григорий Шехет "Treasure hunt in the land of Reactive frameworks"
Ad

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Big Data Technologies - Introduction.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Machine learning based COVID-19 study performance prediction
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation theory and applications.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Big Data Technologies - Introduction.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Machine learning based COVID-19 study performance prediction
The AUB Centre for AI in Media Proposal.docx
Chapter 3 Spatial Domain Image Processing.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation theory and applications.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

Manage react state with MobX

  • 1. Manage React state with MobX Simple, scalable state management Presented by Asif Nawaz
  • 2. What is MobX? • MobX is a super simple state management library. MobX is not a React thing, this is a standalone library, but it’s very popular with React JS. People are very comfortable with this combination.
  • 3. React Has State, why on earth we need MobX? WHY?
  • 4. Look at this component tree State in React JS is pretty component specific thing. It’s hard to pass it to another component and its pretty complex to pass it to a component when it’s bit far away. Imagine we need to change a of B5 component from A3 component.
  • 5. Here MobX is to rescue you • You can create data store with observable array, object etc. with MobX • Import it to multiple components • Share the data between components in an organize way. • No need to pass props through many components to reach the grand child.
  • 6. Installation for “create-react-app” • The Library: npm install mobx –save • React bindings: npm install mobx-react --save
  • 7. Oh! We need decorator support! • npm install babel-plugin-transform-decorators-legacy –-save-dev • npm run eject • Add this babel plugin in webpack config file, webpack.config.dev.js and webpack.config.prod.js
  • 8. It has 4 features • Observable • Observer • Computed • Autorun
  • 10. Pass it to a component
  • 12. autorun • Autorun is for observing multiple variable and do something when their value change.
  • 13. DevTools • Install it: npm install --save-dev mobx-react-devtools • Import and use in a parent level component like this
  • 14. Links • mobx.js.org • mobx.js.org/getting-started.html • github.com/mobxjs/mobx-react-devtools • github.com/foxhound87/mobx-react-form • Presentation would be found here https://www.slideshare.net/secret/36hXs93Ofz06yZ
  • 16. Asif Nawaz A.K.A. asifsaho • Twitter @asifsaho • Facebook fb.me/asifsaho.me • Email: info@asifsaho.me