Preact is quite fast, not merely due to its size. It happens to be amongst the fastest Virtual DOM libraries on the market at present, mainly due to a predictable and straightforward diff implementation.
Preact can support all the browsers even though some polyfills might be needed by it for IE7 and IE8. A large portion of the community has adopted Preact at present. Companies such as Housing.com, m.uber.com, and Lyft have been making use of Preact right now.
Virtually every modern browser, including Firefox, Chrome, Edge, IE11+, and Safari, is supported by Preact. Companies are quickly shifting to it mainly because of the many add-ons and plugins. Below, we have mentioned some of the most notable features of Preact.
As stated earlier, the main advantage of using Preact JS happens to be its small size of only 3kb. This helps make it amongst the most lightweight frameworks or libraries on the market that you will ever come across. Despite having a small size, a quicker render performance is delivered by Preact, unlike its elder brother React, having an altitude of approximately 40kb.
As compared to React, Preact happens to be much more efficient when it comes to memory usage, which implies that less work has to be performed by the garbage collector.
A robust command-line interface tool is offered by Preact, which will enable you to develop innovative projects quickly, and you need not require dealing with web pack or Babel.
Despite being React’s subset, Preact comes with its advanced features. The LinkState module responsible for optimizing state modifications happens to be the most significant of them. React uses arrow functions within a render() process for updating state. This particular method is ineffective with lots of unnecessary code. Preact fixes this issue by using the LinkState module, which returns a handle function while passed in an event and is responsible for automatically updating component state modifications.
Preact, similar to React, uses the identical ES6 API. This implies that the developers can switch to Preact easily at the production time in an already existing project.
Unlike React, the Preact community is relatively small, and there are just 200 contributors on Github. Still, now, Preact is not that popular, and while half a million websites have been created using React, only 20,000 live websites have been created using Preact JS.
One more notable downside with Preact is that createClass is not endorsed by it. Preact supports only ES6 calls-based components and stateless functional components.
Rahul Panchal is a Founder and Managing Director of Rlogical Techsoft Pvt. Ltd, a web & mobile app development company India specialized in Hybrid, Native, Android and iOS App development.
600 E Michigan Ave, Kalamazoo, MI 49007, USA
5 Kew Road, TW9 2PR, London
Peter Klein: +44 753 859 8026
Contact Email: email@example.com
301 1-28-21 Hayabuchi, Tsuzuki-ku, Yokohama-shi, Kanagawa 224-0025, Japan
Contact Email: firstname.lastname@example.org
Suit 3, Level 27, 1 Farrer Place Sydney NSW 2000
Contact Email: email@example.com