Skip to content

Feature Request - Canvas API Implementation #17614

Closed

Description

Is this a bug report?

This is a crucial feature request...

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 8.4.0
Yarn: 0.27.5
npm: 5.4.0
Watchman: 4.7.0
Xcode: Xcode 8.3.3 Build version 8E3004b
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react-native: 0.48.1 => 0.48.1
react: 16.0.0-alpha.12 => 16.0.0-alpha.12

Target Platform: iOS (10.3)

Steps to Reproduce

HTML Canvas API can do amazing things for UI but it's not available in React Native....

  1. Try Canvas API on React Native
  2. Nothing will happen...

Expected Behavior

React Native would fully support Canvas API
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API

Actual Behavior

React Native doesn't respond to Canvas API... that is a huge miss for talented UI designers.
See what you can do with Canvas API here:
https://codepen.io/search/pens?q=canvas+api&limit=all&type=type-pens

and please imagine what if you could use them on React Native.

Reproducible Demo

All React Native apps are demos for this problem.
We need Canvas API fully supported in React Native ASAP.....

Activity

  1. hey99xx commented on Jan 16, 2018

    @hey99xx

    I don't want to belittle your app's needs, but you sound needlessly demanding with

    This is a crucial feature request.
    ...
    We need Canvas API fully supported in React Native ASAP.

    Anyway, this kind of stuff does not really belong to the core React Native. They're probably going to remove WebView component out of the core API soon too. You'd have better luck using something like https://www.npmjs.com/package/react-native-canvas or alternatives to canvas such as:

    I don't know where the expectation that HTML <canvas> API would be supported out of the box comes from. You are not developing a web app with RN.

  2. hey99xx commented on Jan 16, 2018

    @hey99xx

    Canvas API leverages JavaScript for drawing UI. and React Native is javascript-based.

    Not totally correct. Canvas is an HTML5 API. Similarly Node.JS servers can have access to the file system, creating HTTP servers, and creating child processes. These things are not standard JavaScript libraries, they're part of Node.JS offerings. With React Native, you have 3rd JavaScript environment, where there's no window or document objects, no LocalStorage (but AsyncStorage)...

    It's true that RN does polyfill stuff like fetch or navigator.geolocation to be compatible with browsers, but it does not promise to bring entire browser API into its JavaScript runtime.

    Anyways I'll let a dev from FB team comment, but they're probably going to repeat my comment.

  3. hramos commented on Jan 16, 2018

    @hramos
    Contributor

    I have nothing to add to @hey99xx's comments. Closing as we don't typically track feature requests here, only bug reports.

  4. locked as resolved and limited conversation to collaborators on Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions