I am creating a postcard application. To utilize the webcam I am using webkitURL which is available on the window object and building the app using
You haven't declared Component
and using it to extend your class Capture
.
First you need import it like so:
import React, { Component } from 'react'
Or as @masterpreenz suggested in the comment change your class declaration to:
class Capture extends React.Component {
...
}
Replace this
import React from 'react';
import ReactDOM from 'react-dom';
into
import React, { Component } from 'react';
styles
is not defined because you never created the styles object. From your code you're trying to access some properties of the styles
object which are currently not defined.
You need to create the styles
object and define those properties for them to be available.