Now with dynamic auto-width using calc-size()!
Enabling the animation of elements to auto height and width is planned for Chrome 129 🥳 (stable rollout starts in 2 weeks!)
More content to come around this feature from our team soon 🙂
One thing I’m learning is that when you’re making an app, website, api whatever, you’re not making an app , website or api you’re building experiences for your users and that helps change the way you think about it
Problem: There are many React state libraries, so it’s hard to choose between them.
Solution: Think in categories. Many are similar.
6 categories:
1. Route state (Tanstack router loaders, Next.js RSC fetch results) - Data is fetched and cached when a route loads.
2. Remote state (Tanstack query, swr, RTK Query, Apollo) - Data is fetched and cached when a component loads.
3. Atomic (Recoil, Jotai) - Mutable stores (called “atoms”) can be composed. Optimize renders via atom dependency (Jotai), or via string key (Recoil). State is inside React.
4. Unidirectional (Redux, Zustand) - Immutable store. Dispatch actions to change data. Optimize renders via selectors. State is outside React.
5. Proxy (Mobx, Valtio) - Mutable state. Wrap your state in a proxy, so renders are automatically optimized. Valtio uses a hook. Mobx uses an HOC. State is inside React.
6. State machine (XState) - Enforce state transition rules, and visualize state via state charts. State is outside React.
I am Aransiola Favour, contesting in the Accesspreneur NYSC Programme at Delta State Camp sponsored by Access Bank Plc.
The name of my business is ConnectSphere Ltd @connect_sphere.
Please like and retweet to increase my chances of winning.
#MyAccessBank#Access_more#Access
React mistake: Adding specific logic into a reusable component.
How to spot it: Are we adding props and logic to this component for a single, specific use case? Is this making the reusable component *less* reusable?
The solution: Extract specific logic. Make specific logic the responsibility of the caller.
Forcing users to always pass a type argument to your function isn't yet supported in TypeScript.
But until it is, you set the default to be an error message:
@AbioyeModupeol4@headfavour Well, labelling something as inherently 'bad' just because you do not see any 'good' in it 'yet' is definitely not okay IMO