![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A React and Redux notifications system
Tested and works with :
Tested and works with :
Check out the demo
npm install reapop --save
Follow this 4 steps to integrate Reapop to your application.
NotificationsSystem
React componentRender this component at the root of your web application to avoid position conflicts.
import React, {Component} from 'react';
import NotificationsSystem from 'reapop';
class ATopLevelComponent extends Component {
render() {
return (
<div>
<NotificationsSystem/>
</div>
);
}
}
Reapop works with theme. There is no default theme to avoid useless dependencies if you don't use it. So you have to choose one in the list, and follow guidelines of theme to install it.
After this, pass the theme in NotificationsSystem
component props
import React, {Component} from 'react';
import NotificationsSystem from 'reapop';
// 1. import theme
import theme from 'reapop-theme-wybo';
//
class ATopLevelComponent extends Component {
render() {
// 2. set `theme` prop
return (
<div>
<NotificationsSystem theme={theme}/>
</div>
);
}
}
thunk
middleware and add notifications reducer to Redux storethunk
middleware from redux-thunk to your Redux store. Install it with npm install --save redux-thunk
.notifications
to your root reducer.import {createStore, compose, applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
import {reducer as notificationsReducer} from 'reapop';
// store
const createStoreWithMiddleware = compose(
applyMiddleware(thunk)
)(createStore);
const store = createStoreWithMiddleware(combineReducers({
// reducer must be mounted as `notifications` !
notifications: notificationsReducer()
// your reducers here
}), {});
babel-polyfill
packageThis package use some ES6 features, to make it compatible in all browsers, you must :
babel-polyfill
package with npm install --save-dev
babel-polyfill
package at the root of your app with import 'babel-polyfill';
If you are not familiar with react-redux library or the way to connect a React component with a Redux store, I recommend you to read Redux documentation - Usage with React to understand this example.
import React, {Component} from 'react';
import {connect} from 'react-redux';
// 1. we import `notify` (thunk action creator)
import {notify} from 'reapop';
class AmazingComponent extends Component {
constructor(props) {
super(props);
// 4. don't forget to bind method
this._onClick = this._onClick.bind(this);
}
_onClick() {
const {notify} = this.props;
// 3. we use `notify` to create a notification
notify({
title: 'Welcome',
message: 'you clicked on the button',
status: 'success',
dismissible: true,
dismissAfter: 3000
});
}
render() {
return (
<div>
// 5. we notify user when he click on the button
<button onClick={this._onClick}>Add a notification</button>
</div>
);
}
}
// 2. we map dispatch to props `notify` async action creator
// here we use a shortcut instead of passing a `mapDispathToProps` function
export default connect(null, {notify})(AmazingComponent);
If you are not familiar with async actions creator, I recommend you to read Redux documentation - Async actions to understand this example.
// 1. we import `notify` (thunk action creator)
import {notify} from 'reapop';
// we add a notification to inform user about
// state of his request (success or failure)
const sendResetPasswordLink = (props) => (dispatch) => {
axios.post('https://api.example.com/users/ask-reset-password', props)
.then((res) => {
// 2. we use `dispatch` to notify user.
// Status code will be converted in an understandable status for the React component
dispatch(notify({message: res.data.detail, status: res.statusCode}));
})
.catch((res) => {
// 3. same thing here
dispatch(notify({message: res.data.detail, status: res.statusCode}));
});
};
};
Read API documentation to discover all possibilities.
Read Contributing guide
Reapop is under MIT License
FAQs
A simple & customizable notifications system for React
The npm package reapop receives a total of 2,045 weekly downloads. As such, reapop popularity was classified as popular.
We found that reapop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.