Skip to content

Commit

Permalink
=== BEGIN fix-signal-text === Fix SignalValue component when using re…
Browse files Browse the repository at this point in the history
…act-transform
  • Loading branch information
andrewiggins committed Oct 3, 2023
1 parent 1c25f17 commit 622e18e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react/runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ export function useSignals(): EffectStore {
* A wrapper component that renders a Signal's value directly as a Text node or JSX.
*/
function SignalValue({ data }: { data: Signal }) {
return data.value;
const store = useSignals();
try {
return data.value;
} finally {
store.f();
}
}

// Decorate Signals so React renders them as <SignalValue> components.
Expand Down

0 comments on commit 622e18e

Please sign in to comment.