A React component that conditionally adds CSS class name(s) to document.body
npm install react-bodyReact component that conditionally adds CSS class name(s) to document.body
---
🔥 Want to strengthen your core JavaScript skills and master ES6 and React?
I would personally recommend this awesome ES6
and React courses by Wes Bos.
``sh`
$ npm install react-body --save
`jsx`
..where is the CSS class name(s) that must be appended todocument.body when component is rendered and is a truefalse
(defualt) or flag indicating if document.body should actually be
altered.
##### For example:
`js
import React from 'react';
import ReactBody from 'react-body';
class MyComponent extends React.Component {
static defaultProps = {
inverted: false,
};
static propTypes = {
inverted: React.PropTypes.bool.isRequired,
};
render() {
return (
export default MyComponent;
``
The MIT License © 2016-present Konstantin Tarkus (@koistya). All rights reserved.