Skip to content

shvl/react-simple-selfie

Repository files navigation

react-simple-selfie

React wrapper for https://github.com/shvl/simple-selfie

Demo: https://shvl.github.io/react-simple-selfie

Installation

npm install react-simple-selfie

Usage

Here's a basic example of how to use the react-simple-selfie component in your application.

import React, { useRef } from 'react';
import { Selfie } from 'react-simple-selfie';

function App() {
  const selfieRef = useRef(null);

  const captureImage = () => {
    if (selfieRef.current) {
      const image = selfieRef.current.capture();
      console.log(image);
    }
  };

  return (
    <div>
      <Selfie ref={selfieRef} />
      <button onClick={captureImage}>Capture</button>
    </div>
  );
}

export default App;

In this example, we're creating a Selfie component and a button. When the button is clicked, it calls the captureImage function which uses the capture method from the Selfie component to capture the current frame.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published