In this episode of Syntax, Scott and Wes talk about state in React: local state, global state, UI state, data state, caching, API data and more!
LogRocket - Sponsor LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.
Freshbooks - Sponsor Get a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the “How did you hear about us?” section.
Show Notes 3:38 - What is state?
4:58 - What kind of things are kept in state?
12:48 - Global state vs. Local state
21:15 - Managing Local state
31:12 - Approaches to Global state
Redux
Mobx
Based on Observables
Context
Functions just work and update global state.
Apollo
Apollo quires for data in global cache
Links * Thinkso * Learn Node! * Meteor Session * xstate-react * React Context * Mobx * easy-peasy * hype.codes * providerCompose.js * Relay * React Podcast
××× SIIIIICK ××× PIIIICKS ××× * Scott: Command Line Heroes * Wes: MASSDROP CTRL MECHANICAL KEYBOARD
Shameless Plugs * Scott: LevelUpTutorials - Gatsby Ecommerce — Subscribe before price goes up! * Wes: All Courses — Use the coupon code ‘Syntax’ for $10 off!
Tweet us your tasty treats! * Scott’s Instagram * LevelUpTutorials Instagram * Wes’ Instagram * Wes’ Twitter * Wes’ Facebook * Scott’s Twitter * Make sure to include @SyntaxFM in your tweets