Twitter | Search | |
Marvin Hagemeister βš›οΈ πŸ‡©πŸ‡ͺ
Ever wondered why there is both `preact` and `preact/compat`?β“πŸ€” You're not alone!πŸ€ Wrote a post about all the differences and when you should use it βœ…πŸ‘
Reply Retweet Like More
Drake @ PDX Mar 23
This was a really useful read! It’d be beneficial if there was an easy to refer to list of React APIs that if one were to use would necessitate using preact/compat. That way library authors could easily determine whether their library works with preact out of the box.
Reply Retweet Like
Marvin Hagemeister βš›οΈ πŸ‡©πŸ‡ͺ Mar 23
Replying to @Saeris @preactjs
That's basically close to the full list in the article. The only two I didn't mention (but are in compat) are Portals and findDOMNodeπŸ’― The later will likely be deprecated by react soon. With version X compat got a lot smaller because we kicked <React 15 APIsπŸ€
Reply Retweet Like
Daniil Shustov Mar 24
Since props is not filtering ref, does not this just repeats ref prop: <Wrapped {...props} ref={props.ref} />?
Reply Retweet Like
Marvin Hagemeister βš›οΈ πŸ‡©πŸ‡ͺ Mar 24
Yeah, this was done for illustrative purposes. I was worried that people might miss that without explicitly showing that ref is taken from props
Reply Retweet Like
Nicolas Ramz Mar 23
Possible typo in the toChildArray example: I guess it should be "import { toChildArray } from 'preact'" and not mport { toChildArray } from 'react'"?
Reply Retweet Like
Marvin Hagemeister βš›οΈ πŸ‡©πŸ‡ͺ Mar 24
Replying to @warpdesign_ @preactjs
Great catch! You're right that should've read "preact" instead of "react". Just corrected it, hanks for pointing it outπŸ‘πŸ™Œ
Reply Retweet Like