fabian-hiller / modular-forms

The modular and type-safe form library for SolidJS, Qwik and Preact
https://modularforms.dev
MIT License
1.05k stars 55 forks source link

Missing critical detail about @preact/signals-react when following installation guide for React #249

Open jfreyheit opened 2 months ago

jfreyheit commented 2 months ago

@preact/signals v2 requires to add "import "@preact/signals/auto";" at top-level (this is done in Modular form's playground for React, which uses @preact/signals-react v2.2).

However, when following the installation guide, @preact/signals v2 is installed but there's no mention of the need to add this line of code. As a result, signals don't work properly.

We should either install @preact/signals v1 explicitly (through npm install @preact/signals-react@1"), or mention the required extra code.

fabian-hiller commented 2 months ago

We use import "@preact/signals/auto"; as a quick fix in our playground. If I understand correctly, it is usually recommended to use Preact's Bable plugin instead.