Announcing React-RETINA (<canvas> for React v15 & also Preact compatible, and supports variable sized ListView)
Author: xphungCreated Mar 17, 2017Updated Nov 20, 2017
This library is an alternative Canvas implementation for React v15 (which react-canvas has not yet been updated to use). It is also compatible with Preact.
https://github.com/xphung/react-retina
Features:
- Gallery component supports variable sized pages (whereas react-canvas ListView is limited to fixed size pages)
- React-RETINA only uses standard/public React APIs.
- The React Retina design avoids numerous React v15 anti-patterns (which React Canvas/React ART are guilty of using). There are no mixins, string Refs, or even Contexts. It does not use non standard lifecycle methods.
- The React RETINA component library source code is much easier to understand as a result and is leaner and cleaner.
- The View base component is extremely lightweight and specialised components (Image, Text, etc) are built on top of View via a custom draw callback. This is very flexible and allows virtually any drawable shape or component to be built on top of View.
- The React RETINA Backing Store implementation is simpler and cleaner to use - instead of requiring specialised hooks/lifecycle to manage invalidation and repaints, just assign a unique ID to the
useBackingStoreproperty to make the View the cache a repaint. Simply assign a new ID whenever an invalidation and repaint into Backing Store is required ... no need for a special Javascript calls or API to invalidate cache data! - Keyboard events are supported!!
Source: Flipboard/react-canvas