r/reactjs • u/Front-Heron-6640 • Oct 09 '26
Show /r/reactjs Direct reactive assignment & scoped state inside JSX
'@epikodelabs/streamix/react'is an experimental adoption layer we’re designing to bring Streamix atoms, scoped state, derived values, and asynchronous flows directly into React applications.
The underlying idea is simple: bring state closer to where it is used. Instead of juggling hooks, setters, and explicit subscriber bindings, you express state and UI intent directly—and let the integration handle the underlying subscriptions.
What if local state looked like this:
function Profile() {
let title = atom('Ready');
const state = scope({ enabled: true, message: 'Connected' });
return (
<section>
<input
value={title}
onChange={event => title = event.target.value}
/>
<input
type="checkbox"
checked={state.enabled}
onChange={event => state.enabled = event.target.checked}
/>
<p>{title}: {state.message}</p>
</section>
);
}
No useAtom, no manual binding wrappers, no tuple destructuring.
titleacts as reactive state, yet in JSX it reads like a normal primitive.- Direct assignment (
title = ...) writes to the atom. - Referencing it inside JSX sets up the subscribed read.
- Properties inside a
scope()object follow the exact same direct-access reactive pattern.
The atom remains the single source of truth; compiler/integration mechanics handle tracking and updates behind the scenes.
What are your thoughts on this DX? Any immediate concerns or features you'd like to see addressed early on?