react-hooks-full-screen
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

react-hooks-full-screen

A react hooks approach to the Fullscreen API.

Disclaimer: To use hooks a pre-release version of react 16.7 is required. Since the hooks API is subject to change, this library may or may not work with future versions of react.

Install

yarn add react-hooks-full-screen

or

npm install react-hooks-full-screen

Usage Example

import React, { useState } from 'react'
import { useFullScreen } from 'react-hooks-full-screen'
 
const App: React.StatelessComponent = () => {
  const [showFullScreen, setShowFullScreen] = useState(false)
  useFullScreen('app', showFullScreen)
 
  return (
    <div id="app">
      <button onClick={() => setShowFullScreen(!showFullScreen)}>Toggle</button>
    </div>
  )
}
 
export default App

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    110
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    110

Package Sidebar

Install

npm i react-hooks-full-screen

Weekly Downloads

110

Version

0.0.1

License

MIT

Unpacked Size

13.8 kB

Total Files

8

Last publish

Collaborators

  • garthw