@sharyn/hocs

This package provides React High-Order Components.

Usage no npm install needed!

<script type="module">
  import sharynHocs from 'https://cdn.skypack.dev/@sharyn/hocs';
</script>

README

🌹 @sharyn/hocs

npm

This package provides React High-Order Components.

🌹 Install

yarn add @sharyn/hocs

🌹 Usage

hideOnScroll

import React from 'react'

import AppBar from '@material-ui/core/AppBar'
import ToolBar from '@material-ui/core/ToolBar'
import Typography from '@material-ui/core/Typography'
import hideOnScroll from '@sharyn/hocs/hide-on-scroll'

const AutoHideAppBar = hideOnScroll(AppBar)

const App = () => (
  <AutoHideAppBar className="hide-on-scroll">
    <ToolBar>
      <Typography variant="h6" color="inherit">
        Hello
      </Typography>
    </ToolBar>
  </AutoHideAppBar>
)