4 ms·
If a React developer is concerned about code size they can use Preact which is about 5kB: 3kB for Preact core [1], and 2kB for preact-compat [2]. [1] https://p
by metta2uall 5y ago
If a React developer is concerned about code size they can use Preact which is about 5kB: 3kB for Preact core [1], and 2kB for preact-compat [2].
[1] https://preactjs.com/ https://preactjs.com/
[2] "preact-compat adds somewhere around 2kb to your bundle size, but has the advantage of supporting the vast majority of existing React modules you might find on npm" https://preactjs.com/guide/v8/switching-to-preact/ https://preactjs.com/guide/v8/switching-to-preact/
- newlisp 5y agoWhat's the catch of preact? how can it be so small and provide the features/compability?
- metta2uall 5y agoThe major difference seems to be that preact uses native browser events, unlike react which implements "synthetic events" - so preact may have issues in old browsers like IE8 (https://preactjs.com/about/project-goals/ https://preactjs.com/about/project-goals/)