Closed JonAbrams closed 3 months ago
I think it's better to just replace @preact/signals-react
-> @preact/signals-react/runtime
in README.md
Seems inconsistent to re-export useSignal
but not useSignals
from the same place.
What is the problem to import it from runtime? It's logically little bit different stuff
Adds an extra import statement, for no reason. Itβs just cleaner to have all of a modules exports in one place.
On Fri, Dec 22, 2023 at 14:25 Valerii Smirnov @.***> wrote:
What is the problem to import it from runtime? It's logically little bit different stuff
β Reply to this email directly, view it on GitHub https://github.com/preactjs/signals/issues/473#issuecomment-1868106127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJPPVAV2JOUYM44DVW2F53YKYCFXAVCNFSM6AAAAABA7M4NL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGEYDMMJSG4 . You are receiving this because you authored the thread.Message ID: @.***>
Cleanliness isn't so much relevant as intended default usage -- useSignals
being exported from a subpath (/runtime
) would indicate it's more of an "opt-in" than a default.
Not 100% sure what Andre had meant for though. @andrewiggins friendly ping if you're not too busy with holiday stuff
Yes please fix the README for those of us too lazy to read the Issues π. I'm a brand new user of @preact/signals in a React project, so this was a bit of head scratcher at first wondering why things weren't working, uh, reactively...also, my project doesn't use Babel.
Anyway, keep up the good work and thanks for the clarifications, everyone π
I think it's better to just replace
@preact/signals-react
->@preact/signals-react/runtime
in README.md
Just noting here that readme on npm site still shows outdated documentation.
I think it's better to just replace
@preact/signals-react
->@preact/signals-react/runtime
in README.mdJust noting here that readme on npm site still shows outdated documentation.
It will be updated with the next release. It is possible to release it with only changes in readme, too
According to the docs, I should be able to
import { useSignals } from '@preact/signals-react'
, but sinceuseSignals
is not re-exported, I need to do this instead:import { useSignals } from '@preact/signals-react/runtime'
.