from How to Sync Your React App with the System Color Scheme https://wp.me/p4wJUi-6wR
Day: May 20, 2020
Pinterest’s UI Component Library via /r/reactjs
I don’t why it is not popular, just recently discovered it. Thought I’d share it with you guys https://pinterest.github.io/gestalt
from Pinterest’s UI Component Library https://wp.me/p4wJUi-6w3
build Weather App Using React.js
from build Weather App Using React.js With Current Location & Search City – Html Hints https://ways4eu.wordpress.com/?p=24950
Animated Sparkles in React via /r/reactjs
Handle Async Image Loading in React with a Suspense library โก๏ธ via /r/reactjs
TLDR, I wrote a Suspense-like async loading, native, performant React <img> component library.
Today, I’ve published major changes to it, wanting to hear feedback from the community.
A short quote from HTML Spec on why do we need a separate library like react-shimmer :
Without the decode() method, the process of loading an img element and then displaying it might look like the following:
const img = new Image(); img.src = “nebula.jpg”;
img.onload = () => { document.body.appendChild(img); };
However, this can cause notable dropped frames, as the paint that occurs after inserting the image into the DOM causes a costly decode on the main thread.
This can instead be rewritten using the decode() method:
const img = new Image(); img.src = “nebula.jpg”;
img.decode().then(() => { document.body.appendChild(img) })
This latter form avoids the dropped frames of the original, by allowing the user agent to decode the image in parallel, and only inserting it into the DOM (and thus causing it to be painted) once the decoding process is complete.
Since we are using React, how do we suppose to use decode()
?
Introducing the Release v3.0.0 ๐ค๐ผ๐
- Source code has been rewritten in TypeScript.
- Built-in
decode()
before paint. - Native <img>
component props (all of them) are preserved. - Enforced “separation of concerns” between the actual async handling logic and loaders. New pluggable-loader architecture.
- Better dependency management + deploy/publish process.
- Zero dependencies.
Check it out!
Repo: https://github.com/gokcan/react-shimmer
CodeSandbox: https://codesandbox.io/s/nh9x1
from Handle Async Image Loading in React with a Suspense library โก๏ธ https://ways4eu.wordpress.com/?p=24970
How to generate default avatar images, the nice and beautiful way. ๐๐ via /r/reactjs
from How to generate default avatar images, the nice and beautiful way. ๐๐ https://ways4eu.wordpress.com/?p=24978
Chemist Audrey Miyamoto Prepares Apollo 11 Sample for Analysis

Picture of the day for May 20, 2020

Art Quote of the Day
“What I wanted to do was to paint sunlight on the side of a house.” – Edward Hopper
Wikipedia article of the day for May 20, 2020
