Anton Ignatov retweeted
🚀 Framer Motion 8.1 introduces MotionValue.jump()
jump() sets a motion value while breaking from its history:
- Ending current animations
- Resetting velocity to 0
- Bypassing attached springs
framer.com/docs/motionvalue/…
Anton Ignatov retweeted
My new VSCode extension is nearly ready. The goal is to teach you TypeScript without leaving your IDE. That means:
1⃣ Human-readable error translations (build on top of the TS error translator)
2⃣ Hoverable hints on TS syntax to explain what it means
I'm looking for testers.
Anton Ignatov retweeted
Using `useReducer` to manage one-way boolean state has become one of my favourite tricks lately.
Anton Ignatov retweeted
A small detail, but one that folks using server-side rendering might appreciate. React 18 adds an onRecoverableError callback to hydrateRoot so you can get notified about hydration mismatches in production. Helps find regressions!
This Post is from an account that no longer exists. Learn more
Anton Ignatov retweeted
Companies where engineers frequently write & send project updates to internal audiences are places where, as an engineer, you get to learn to write - and communicate - on the job.
Uber was a place like this and it's something I really appreciated.
An example of such an update.
Anton Ignatov retweeted
🧵 TypeScript React props: interfaces vs type aliases
@benmvp some nuances to help you make a choice, like describing the different override behavior
TL.DR:
- uses interface by default
- apart edge cases, it doesn't matter much
benmvp.com/blog/typescript-r…
Anton Ignatov retweeted
Great news for React + TypeScript!
The following can now work without any type error:
teapawt.net/AndaristRake/status/14…
Wow, this is huuuuuge: github.com/microsoft/TypeScr…
Anton Ignatov retweeted
🆕 #GUIchallenges 🦇
responsive multi-select UX
Peep the video youtube.com/watch?v=x0aCdLDZ…
Read along web.dev/building-a-multi-sel…
Try the demo gui-challenges.web.app/multi…
[video alt]
UX preview across MacOS Safari, iOS Safari (iPad and iPhone), Android Chrome, Firefox and desktop Chrome
Anton Ignatov retweeted
🔥 JavaScript's new .at() method lets you pick items based on their index.
This is super handy for grabbing the last item of an array or string because, unlike arrays, it supports negative indexes!
![// 🔥 New .at() method on arrays and strings const toppings = ['pepperoni', 'cheese', 'mushrooms']; // The old way to grab the last item toppings[toppings.length - 1]; // mushrooms // using .at() method with a negative index toppings.at(-1); // mushrooms // works with any index toppings.at(0); // pepperoni toppings.at(-2); // cheese // and with strings! 'Meeting Room: B'.at(-1) // B](https://pbs.twimg.com/media/E-nFweJX0Ac67A4.jpg?name=small&format=webp)
ALT // 🔥 New .at() method on arrays and strings const toppings = ['pepperoni', 'cheese', 'mushrooms']; // The old way to grab the last item toppings[toppings.length - 1]; // mushrooms // using .at() method with a negative index toppings.at(-1); // mushrooms // works with any index toppings.at(0); // pepperoni toppings.at(-2); // cheese // and with strings! 'Meeting Room: B'.at(-1) // B
Anton Ignatov retweeted
Just made public a project I worked on last month – React render tracker. It should help find hidden work that is causing performance issues like unintentional re-renders and unmounts. It's just a MVP/proof of concept, but what do you think of it? 🤓
github.com/lahmatiy/react-re…
Anton Ignatov retweeted
Pro Tip: want IDE auto-completion on JS config files?
Just add some extra JSDoc type annotations
Simpler than compiling the TS config to JS or using ts-node
Anton Ignatov retweeted
A six-year-old feature request finally got agreement to land in the HTML spec. Next up, implementing it in all the browsers!
This exposes the browser's built-in deep object cloning abilities, without history.state hacks or an async hop through postMessage().
Define self.structuredClone() (thanks surma!)
github.com/whatwg/html/commi…
Anton Ignatov retweeted
It's 2021 and web development feels nowhere near this. Is anyone working on tools like this? worrydream.com/#!/LearnableP…
Anton Ignatov retweeted
And this looks like the best workaround!
Use a ref function instead of a ref object
teapawt.net/e1g/status/14128023610…
Replying to @sebastienlorber @phry
The issue is while *you* are happy to accept any DOM node, React is not happy to have to assign your generic value to a strictly typed $ref arg for each concrete element such as div.
One solution is to mimic this with a function ref typescriptlang.org/play?jsx=…
Anton Ignatov retweeted
☣️ Jamstack: be careful, there's no standard ☢️
➡️ Each static host serve HTML files differently
✅ Use github.com/slorber/trailing-…
💡 Useful to debug common issues related to trailing slash, SEO, server redirects...
Anton Ignatov retweeted
Very cool, Apple’s documentation engine for pages like the SwiftUI tutorials have become available for anyone to re-use via DocC: developer.apple.com/document…
Anton Ignatov retweeted
Used my first ES module in a vanilla static HTML file (no build tool).
Find it cool that we can use any npm module easily thanks to @skypackjs
Note: for my use-case, I don't need to support older browsers
Anton Ignatov retweeted
GraphQL friends 👋
I'm collecting a list of exciting GraphQL libraries for people at @FormidableLabs. Any I need to know about? Any you're excited about? 🙌







![const [isEnabled, enable] = useReducer(() => true, false);](https://pbs.twimg.com/media/FRzBvUIagAAFKfT.jpg?name=small&format=webp)





















