Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 575 Bytes

ClassNames.md

File metadata and controls

20 lines (12 loc) · 575 Bytes

<ClassNames>

Side-effect component that when mounted sets class names on a given DOM element and removes them, when it is being unmounted.

Usage

import {ClassNames} from 'libreact/lib/ClassNames';

<ClassNames list={['some-class', 'another-class']} />

Props

  • list — required, array of string, list of class names to set.
  • el — optional, DOM element on which to set the class names, defaults to document.body.
  • persist — optional, boolean, whether to keep the class names when component un-mounts, defaults to false.