1.1.0 • Published 4 years ago
react-fluid-toggle-button v1.1.0
React Button Component
A React Button that have React Toggle button with different props
Getting Started
$ npm i react-fluid-toggle-button --save
or
$ yarn add react-fluid-toggle-button
Overview
A React Button that have React Toggle button with different props.
<ButtonPage editItem={this.state.editItem} handleClick={this.handleClick} />
Props in more detail:
See details about each key below.
editItem
This is the state of button.
handleClick
This will toggle the button & change the behaviour of the button .
Usage
import React, { Component } from 'react';
import ButtonPage from './ButtonPage.jsx';
class MainPage extends Component {
state = {
editItem: false
};
handleClick = (e) => {
this.setState({
editItem: !this.state.editItem
});
};
render() {
return (
<div>
<ButtonPage editItem={this.state.editItem}
handleClick={this.handleClick} />
</div>
)
}
}
export default MainPage;