preactjs / signals

Manage state with style in every framework
https://preactjs.com/blog/introducing-signals/
MIT License
3.81k stars 95 forks source link

Type 'ReadonlySignal' is not assignable to type 'ReactNode'. #590

Closed pmartin-cogility closed 3 months ago

pmartin-cogility commented 3 months ago

Environment

Describe the bug Since the update to @preact/signals-core to 1.8.0, I get the following error: Type 'ReadonlySignal' is not assignable to type 'ReactNode'. when using a signal as so...

function Optimized() {
  // Text automatically updates without re-rendering the component:
  return <p>{count}</p>;
}

Forcing a downgrade to @preact/signals-core to 1.7.0 fixes the issue.

JoviDeCroock commented 3 months ago

Normally this change takes care of that, do you have some override yourself to manage this or is TypeScript not recognising the import?

pmartin-cogility commented 3 months ago

Perhaps the issue is that "this change" for @preact/signals-react hasn't been published yet?

JoviDeCroock commented 3 months ago

😅 you are 100% correct, apologies

pmartin-cogility commented 3 months ago

Thank you for the amazing libraries!