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 23 Mar 19
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 ⚛️ 23 Mar 19
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 24 Mar 19
Since props is not filtering ref, does not this just repeats ref prop: <Wrapped {...props} ref={props.ref} />?
Reply Retweet Like
Marvin Hagemeister ⚛️ 24 Mar 19
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 23 Mar 19
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 ⚛️ 24 Mar 19
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