Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you think React Canvas is a thing you could have used?

https://github.com/Flipboard/react-canvas

I've still not had a chance to play around with it, but the Flipboard mobile site looks phenomenal.



That looked interesting but I didn't need the most important functionality it provides (click/touch handling, fancy text rendering, etc) so I stuck with just using the Canvas API. It's pretty simple to do in React: https://gist.github.com/thomasboyt/bcc496c823a01ac5f648


I might be missing something here: what benefit does React bring in this example? If you're using canvas to render without any kind of virtual DOM, why use React at all?


Can't you combine? Thinking it could be used for UI. Makes sense when you need more support, like localisation and other builtin stuff. Just guessing.


Oh, nothing on its own in that tiny example. In practice, it's just a component that could be used in a larger application and can be easily tied into the same rendering and state trees.


From my understanding, React Canvas handles which parts to redraw for you. Redrawing the entire Canvas with each frame is not performant.


Canvas is nice... until you need to embed a video into it.


cant you avoid that by using a video element, and placing it over the canvas with CSS?


Not if you use clipping-paths in the canvas, or if you want to partially overlay the video with canvas elements.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: