preactjs / signals

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

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

Closed pmartin-cogility closed 1 month ago

pmartin-cogility commented 1 month 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 1 month 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 1 month ago

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

JoviDeCroock commented 1 month ago

😅 you are 100% correct, apologies

pmartin-cogility commented 1 month ago

Thank you for the amazing libraries!