cogo-toast-react-17-fix

4.2.7 • Public • Published

cogo-toast-react-17-fix

A compatibility fix for the popular 'cogo-toast' package that resolves dependency conflicts with React 17+.

Problem

The original cogo-toast library has a strict peer dependency on React 16. This causes installation and compatibility issues when used with React 17 or newer versions.

Solution

The 'cogo-toast-react-17-fix' package provides the necessary modifications to ensure that cogo-toast functions correctly within React 17+ environments.

Installation

npm install cogo-toast-react-17-fix

Usage

Import and use the provided cogoToast component exactly as you would in the original 'cogo-toast' package. There are no additional changes required.

import cogoToast from 'cogo-toast-react-17-fix';

cogoToast.success('This is a success message!');

Example

import React from 'react';
import cogoToast from 'cogo-toast-react-17-fix';

const App = () => {
  const handleButtonClick = () => {
    cogoToast.error('This is an error message!');
  }

  return (
    <button onClick={handleButtonClick}>Show Error Toast</button>
  );
}

export default App;

Important Notes


Love It? Star It ⭐!

Become one of our amazing stargazers by giving us a star ⭐ on GitHub!

It's just one click, but it means the world to me.

Stargazers for @omkarcloud/cogo-toast-react-17-fix

Package Sidebar

Install

npm i cogo-toast-react-17-fix

Weekly Downloads

338

Version

4.2.7

License

MIT

Unpacked Size

29.7 kB

Total Files

6

Last publish

Collaborators

  • omkar111111