Hacker News new | ask | show | jobs
by digianarchist 381 days ago
The blog post compares an example using hooks to pass in a state and update function to a child component. It then compares that to a Svelte component which contains a state variable.

Those two examples aren't equivalent because any parent component wrapping the Svelte component doesn't have access to the state whilst App (in the React example) does.

For the Svelte example to be equivalent, the component would have to export the store.

A minor gripe but the hooks vs Svelte state is pretty minor issue in itself.