Using canvas with React Native – Over Engineering – Medium

Use canvas with React Native:  #ReactJS #JavaScript

  • Most of the work is in defining which methods and properties should be made public in React Native:Context uses the postMessage implementation, in Canvas; so the bridge is shared and all the queueing logic is reused.
  • When we call a method or set a property: canvas.webview.postMessage sends a message to a canvas in the Webview.
  • The Canvas component doesn’t expect a return message from this.If we need to call a canvas or context method, we call the method and send the serialized return value back.
  • This library has provided a way for me to access the canvas API, but I also need a way to load images from a remote source.The canvas API provides a drawImage method, which could accept another canvas (or a browser Image object) as a source.
  • So, I can now use either to load an image, and then make changes to the image; using the browser canvas API.That’s all, for nowI’ve enjoyed working with this library, so far.

React Native is the Wild West. There’s so much to discover and build, and it can be a fun journey. Sometimes, before you can start panning for gold, you have to make the tent you’re going to sleep in…
Continue reading “Using canvas with React Native – Over Engineering – Medium”

Using canvas with React Native – Over Engineering – Medium

Using canvas with React Native  #canvas #reactnative #react #reactjs

  • Most of the work is in defining which methods and properties should be made public in React Native:Context uses the postMessage implementation, in Canvas; so the bridge is shared and all the queueing logic is reused.
  • When we call a method or set a property: canvas.webview.postMessage sends a message to a canvas in the Webview.
  • The Canvas component doesn’t expect a return message from this.If we need to call a canvas or context method, we call the method and send the serialized return value back.
  • This library has provided a way for me to access the canvas API, but I also need a way to load images from a remote source.The canvas API provides a drawImage method, which could accept another canvas (or a browser Image object) as a source.
  • So, I can now use either to load an image, and then make changes to the image; using the browser canvas API.That’s all, for nowI’ve enjoyed working with this library, so far.

React Native is the Wild West. There’s so much to discover and build, and it can be a fun journey. Sometimes, before you can start panning for gold, you have to make the tent you’re going to sleep in…
Continue reading “Using canvas with React Native – Over Engineering – Medium”