Advertisement · 728 × 90

Posts by Ricky

We’re pretty close to having an initial Rust port of React Compiler. My approach was to iterate on the plan document (write it manually, have the agent expand, edit, repeat). Then try to run it, see what goes wrong, revert back to the plan, tweak the plan, repeat.

1 month ago 99 12 4 7

IIRC we didn’t do that because we would like to change it to be an installer to select any of the well known frameworks instead

1 month ago 6 0 0 0

Does this implement the performance tracks for server components and server requests yet?

1 month ago 0 0 1 0

100% agree

1 month ago 7 0 0 0
Preview
useActionState – React The library for web and native user interfaces

useActionState is a new hook for forms, async reducers, and more. It now has great new documentation: react.dev/reference/re...
Thank you to @ricky.fm for writing.
Thank you to @aurorascharff.no, @danabra.mov, @samselikoff.com, @stephanjnoel.bsky.social, @brenelz.com, and @yadiel.dev for reviewing.

1 month ago 16 5 0 0

Oh I see what you mean. Yeah I don’t know how you would do that with this hook though.

2 months ago 0 0 0 0

If you’re posting to a /toggle endpoint it’s still not safe. Not sure there’s general guidance here. That’s why for most cases I would either just let them queue (using optimistic to update the UI), or disable the button while in flight

2 months ago 0 0 1 0
Post image

That already works, this is the trace I built the docs from

trace.cafe/t/BseVMSJlNx

2 months ago 1 0 1 0
Preview
React Performance tracks – React The library for web and native user interfaces

We did, check out: react.dev/reference/de...

The thing I'm adding is being able to show what the DevTools Profiler will show you when you run it, embedded in the docs themselves.

2 months ago 0 0 1 0
Advertisement
Preview
React Performance tracks – React The library for web and native user interfaces

For tracking where updates came from, you can click the "update" in the tracks to see were the setState came from.

Here's an example: react.dev/reference/de...

2 months ago 0 0 0 0

We show the component tree in the Components track. We'd like to make it easy to click to go to the Components tab for React DevTools, but that requires the browser to add link support.

2 months ago 0 0 1 0
Video

Does this diagram help? It uses the React Performance Tracks to explain what React is doing, and what you'll see when you use the tracks:

github.com/reactjs/reac...

2 months ago 30 3 3 1
Post image

Adding more information to React error pages

github.com/reactjs/reac...

2 months ago 38 1 0 0

You can use Fragment refs for observers, but otherwise it's not clear why you can't use an effect for this?

2 months ago 0 0 1 0
Preview
useEffectEvent – React The library for web and native user interfaces

useEffectEvent makes handling events in Effects much easier and saves unnecessary unmounting and remounting of listeners. It now has awesome new docs: react.dev/reference/re...

Thank you to @ricky.fm the updates, and @danabra.mov and @stephanjnoel.bsky.social for reviewing

2 months ago 42 6 1 0
Preview
Rewrite useActionState by rickhanlonii · Pull Request #8284 · reactjs/react.dev Preview First commit: claude Second commit: my edits I need to do some more passes, but it's ready to review. cc @samselikoff @gaearon @stephan-noel @aurorascharff @brenelz @MaxwellCohen @her...

Rewrote the useActionState docs, does this make sense?

github.com/reactjs/reac...

2 months ago 27 4 4 0

adding event handlers is subscribing to an external system (the DOM) so it fits for events.

2 months ago 1 0 0 0

Take me down to the Parallax city where the far moves slow and the near moves quickly

2 months ago 16746 4860 94 74

Why do you need to attach the listener in a ref callback? We flush effects sync in updates for user events exactly for this use case

2 months ago 1 0 2 0
Advertisement

Yes

2 months ago 0 0 0 0

There are two blockers to autodeps. 1) people really hate the idea of not seeing the array (but that’s fine, you could still choose to write it) and 2) if you think about useEffectEvent primarily as “untracked” then you need to see the deps. But if you think of it as separating events, you don’t

2 months ago 2 0 1 0

Yeah I love that. And that works with my other concern: how does this make sense with auto deps where you don’t write/see the dependency array.

2 months ago 0 0 1 0
Post image

It’s a caveat listed below this

2 months ago 0 0 1 0

My thought process is “i need to connect to a socket and subscribe to a connect event. I don’t want to resubscribe for that event, so let me move this to an effect event”

2 months ago 0 0 1 0

The problem is thinking from the components perspective (how props flow in) not the effects perspective (what values resubscribe).

The thought process should be the same with or without the dependency array.

2 months ago 0 0 1 0

It doesn’t do any tracking internally it just mutates a ref with the last rendered function to update the closure.

2 months ago 1 0 1 0
Preview
useOptimistic – React The library for web and native user interfaces

@ricky.fm Thank you for updating react.dev/reference/re... page.

Also thanks to @danabra.mov, @aurorascharff.no @stephanjnoel.bsky.social, @brenelz.com for adding feedback

2 months ago 15 2 0 2

Btw the preview link works

2 months ago 1 0 0 0
Advertisement

What's the use case?

2 months ago 0 0 1 0

Maybe it's

"This lets you call this function from a Effect as an "event". Since it's an event, the Effect does not need to include it as a dependency. Please read Dan's learn docs about this, they're very good."

2 months ago 0 0 1 0