Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Preact signals-react bindings (basic)

$
0
0

One small thing you could change - currently, the actual type of the signal isn’t carried with the typings, so getValue/setValue is essentially any . By adding a type parameter to Signal.t and using that in your bindings, you’ll get the proper typings derived from the signal as it was created:

Argh, I thought it was odd that I was not getting an error when printing out the value. Your suggestion was actually part of my first attempt and somewhere along the way i removed it as I was was trying to understand how to create bindings to a Javascript/Typescript class.

Making that change triggered the error in my React.string because now getValue is carrying the type. Thanks!!


Viewing all articles
Browse latest Browse all 2592

Trending Articles