denislamard premium asked 4 years ago


Hello,

I would to know how to use toatr to show notifications on my page. I use react and MDB Pro (react version).

Could you have an simple example into a complete react page.

I really thanks

Best regards Denis LAMARD

below a example : class App extends Component {

constructor(props) {
    super(props);

    this.state = {
        notifications: 1,
        user: {
            userID: 1000,
            firstName: 'Denis',
            lastName: 'Lamard'
        }
    }
    this.handleClick = this.handleClick.bind(this);
}

handleClick() {
    this.setState(state => ({
        notifications: this.state.notifications + 1
    }));
}

render() {
    return (
        <Fragment>
            <NavbarPage user={this.state.user} notifications={this.state.notifications}/>
            <h1>App</h1>
            <MDBBtn tag="a" size="1x" floating gradient="blue" onClick={this.handleClick}>
                <MDBIcon icon="bolt"/>
            </MDBBtn>

        </Fragment>
    );
}

}



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: 4.25.0
  • Device: PC
  • Browser: chrome
  • OS: WIndows, linux
  • Provided sample code: No
  • Provided link: No