React Migration in Toast Component
This section explains how to migrate the Toast component from EJ2 React to React. It provides a detailed comparison of APIs, including props, methods and events.
Properties
| EJ2 React | React | Description |
|---|---|---|
Props: | Props: | The |
Props: | Props: | The |
Props: | Props: | The |
Props: | Props: | The |
Props: | Props: | The |
Props: | Props: | In EJ2 React, Toast requires a reference and explicit |
Props: | Props: | The |
Props: | Props: | In EJ2 React, the progress bar is controlled using the |
Methods
| EJ2 React | React | Description |
|---|---|---|
Methods: | <ButtonComponent onClick={this.toastInstance.show()}> Show Toast </ButtonComponent> <Toast ref={toast => this.toastInstance = toast} content="Show button clicked" /> | The |
Methods: | <ButtonComponent onClick={this.toastInstance.hide()}> Show Toast </ButtonComponent> <Toast ref={toast => this.toastInstance = toast} content="Show button clicked" /> | The |
Methods: | useEffect(() => { return () => { console.log('destroyed'); }; }, []); <Toast variant={Variants.Circle}></Toast> | The |
Events
| EJ2 React | React | Description |
|---|---|---|
Event: | Event: | The |
Event: | Event: | The |
Event: | Event: | The |
Events: | useEffect(() => { return () => { console.log('destroyed'); }; }, []); <Toast className="my-toast" progressBar={true} content="Show button clicked" /> | The |