Open in app
Alex Ewerlöf
1.2K Followers
About

Sign in

1.2K Followers
About
Open in app

…xcept that we’re storing the value outside of our component, which could cause problems if you have more than one component per file. You might want to use this for setting default values if the values are not tied to your store, ot…

Where to Hold React Component Data: state, store, static, and this
3.9K
24

Sam Corcos

Alex Ewerlöf

Alex Ewerlöf

Mar 9, 2018·1 min read

even if you have one component per module, but all instance of the component share the module-level variables. Essentially the use-case aren’t that different from static properties.

Written by

Alex Ewerlöf

Knowledge Worker, MSc Systems Engineering, Tech Lead, Web Developer

More from Alex Ewerlöf

Knowledge Worker, MSc Systems Engineering, Tech Lead, Web Developer

More From Medium

Node shebang

Alex Ewerlöf

A visual history of web APIs

Alex Ewerlöf

Async map with limited parallelism in Node.js

Alex Ewerlöf in codeburst

Trump’s Downfall Bears a Striking Resemblance to the Final Days of Ted Bundy

Joe Duncan

We’re About to Experience the Fakest Economic Boom In History

Concoda in Concoda

How One Article Has Paid My Mortgage the Last 23 Months

MICHAEL THOMPSON in Mind Cafe

Stop this Microservices Madness

Federico Pugliese in The Startup

I Almost Got Fired for Choosing React in Our Enterprise App

Razvan Dragomir in Better Programming

About

Help

Legal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store