Sometimes you end up with a lot of Providers in React.
It can make your root component quite nested and hard to read.
Use this utility function to combine a list of Providers into a single Provider.
👉 https://t.co/lSXJAm9gdV https://t.co/NW5EdVjThU
⚡️ When naming your components, always form a sentence like "A Link with an Image" = LinkImage. "A List with Checkmarks" = ListCheckmark. The resulting names may seem less natural, but it greatly helps with organizing your components. https://t.co/JfSB3KazEt
? React Day Tip: You can make your function component work as a PureComponent by using React.memo()
https://t.co/7XtcLGlekp https://t.co/0cUMuo0u3v
Oh you haven't heard of "presentational" attributes?
It means they listen to CSS. If you ain't keen on adding a bunch of attributes, you can use CSS. Even styled-components. https://t.co/jFllGjJYlR
React Tip: Use the useRef Hook to declare instance variables. Here's an example of checking if the component is mounted to avoid setting state on an unmounted component.
#react https://t.co/fMttullH6P
You know that nasty issue where {...state, x: 1} is not pointer equal to state itself if x didn't actually change? Causing unnecessary updates, e.g. when spreading object & passing as React prop? Here is a lib to solve it!?
https://t.co/fmNpGrMWY0 https://t.co/H5vXXqqqQX
Most markdown processors - GitHub included - allow for a diff code block. Handy when you are trying to show new lines added https://t.co/PogAgerpU5
? Need to dynamically embed your @CodePen into your @gatsbyjs blog or #ReactJS app? Use #javascript's `createElement()` to insert the needed script to your HTML inside the blog post `componentDidMount()`: https://t.co/LHa5cqpukg #js #gatsbyjs #codepen https://t.co/NFFNHJ9CW5
Did you know: you don’t need a library to separate stateful logic from your component definition (and you don’t have to do it either — but some people want to). https://t.co/LGiE4BQ7gP https://t.co/p2XM9TNefx
Got a React component that is largely text content? Might be useful to leave it as Markdown.
https://t.co/eH0mymUg2v https://t.co/B4ybEdSim9
One liner for double line breaks into #faker paragraphs when using #reactjs and #es6 https://t.co/pkJHs92S0E
Hate having to name your styled components? This one liner <Div /> component is for you! ??
Live demo + discussion: https://t.co/OrJgKoQFPT https://t.co/nyIXFwsMaM
babel-plugin-sitrep
Just add `// sitrep` above your fn and the plugin will log vars and return value.
https://t.co/m8VlUcNlsn https://t.co/tfDcEGlcgU
On that render function hype train. Simple component to load children conditionally based on data availability https://t.co/gLmCLMGL4C
I think this is a cool React paradigm I see nobody doing. Set a prop when you want an action to take place, no children-as-function needed! https://t.co/mwiDYSve0E
Styling your React components in 2017. ChaoticEvil is legit. ? https://t.co/MNMfbLNnKy
Using React from CDN? Add <script crossorigin> attribute and check the headers. This is important for better error handling DX in React 16! https://t.co/vbhDvnh45T
Once you treat views as functions, we can easily compose, filter, map, reduce etc. like with any function. #reactjs
https://t.co/gOkluiZDKA https://t.co/9U5OHczwss
? React Native + modern JS https://t.co/pIxvKt8O4W
Haven't seen this React pattern yet. Very elegant from my point of view. WithState: the Component as a view prop.
https://t.co/xJ3azBAMoN https://t.co/Me0gxoETaa