1.2.1 • Published 7 years ago

react-blocker v1.2.1

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

react-blocker

USAGE

You should ready this babel-plugin-transform-decorators-legacy

then....

npm install react-blocker --save

import reactBlocker from 'react-blocker';


@reactBlocker((props) => {
  // handle props and return a valid react element
  return (<div>you are blocked</div>)
})
class Example extends React.Component {

  render() {
    return (
      <div>
        hello world
      </div>
    );
  }
}

render(<Example />, document.getElementById('root'));

Or you can use object as arguments

@reactBlocker({
  componentWillMount() {},
  componentWillReceiveProps() {},
  blockFunc(props){
    return (<div>you are blocked</div>)
    // this is equivalent to the just use a function as a argument
  }
})
1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago