React Canvas: High performance rendering React Group

Source: Internet
Author: User

React Canvas provides the ability to render a mobile Web APP interface using canvas instead of traditional DOM rendering, with a much closer experience with the Native app. React Canvas provides a standard set of React components that are abstracted from rendering elements based on them.

GitHub Source Download

 

Example code:

var React = require (' React '); var Reactcanvas = require (' React-canvas '); var Surface = Reactcanvas.surface;var Image = React Canvas.image;var Text = Reactcanvas.text;var MyComponent = React.createclass ({render:function () {var surfaceWidth    = Window.innerwidth;    var surfaceheight = window.innerheight;    var imagestyle = This.getimagestyle ();    var textStyle = This.gettextstyle (); Return (<surface width={surfacewidth} height={surfaceheight} left={0} top={0}> <image style={imageSt        YLE} src= ' ... '/> <text style={textstyle}> Here's some Text below an image.  </Text> </Surface>);  }, Getimageheight:function () {return math.round (WINDOW.INNERHEIGHT/2); }, Getimagestyle:function () {return {top:0, left:0, Width:window.innerWidth, HEIGHT:THIS.G  Etimageheight ()}; }, Gettextstyle:function () {return {top:this.getImageHeight () + Ten, left:0, Width: Window.innerwidth, Height:20, lineheight:20, fontsize:12}; }});

  

Related articles that may be of interest to you
    • The JQuery effect "attached source" is very useful in website development
    • Share 35 amazing CSS3 animation effects Demo
    • Stunning 8 x HTML5 & JavaScript Effects
    • Web development in a very practical 10 effects "source Download"
    • 12 Classic white-rich jQuery images Carousel Plugin

This article links: React Canvas: High Performance rendering React components

Compilation Source: Dream Sky focus on front-end development technology sharing web design resources

React Canvas: High performance rendering React Group

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.