Support `REACT_RECOVERABLE_TYPE` in `use`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 38.9k
- Forks
- 2.4k
- Avg merge
- 20h 18m
- Merged PRs (30d)
- 35
Description
Describe the feature you'd love to see
A clear and concise description of what you'd love to see added to Preact.
In React 19.3, browser is introducted to use with use for early return on non-browser environments. https://react.dev/blog/2026/09/09/react-19-3#new-react-dom-features
Inside use, they used REACT_RECOVERABLE_TYPE for returning undefined.
https://github.com/react/react/blob/main/packages/react-dom/src/shared/ReactDOMBrowser.js
In ReactLynx, we have dual-thread concept, we are planning to provide some API like browser but for background thread, the API may be like:
function CameraPanel() {
use(background('Camera APIs are unavailable on Main Thread'));
// IFR (main thread) does not go here
const camera = NativeModules.Camera;
return <CameraView camera={camera} />;
}
Will use API support something like REACT_RECOVERABLE_TYPE for safely return nothing and continuing rendering?
Additional context (optional)
Add any other context or screenshots about the feature request here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Preact's use entry point and compare its behavior with the referenced React files: ReactDOMBrowser.js and ReactFiberHooks.js around lines 1167–1171. Clarify how a recoverable value or background-thread API should behave, then define tests for safely continuing rendering when the condition is encountered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100