
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-router-redirect
Advanced tools
yarn add react-router-redirect or npm install react-router-redirect --save
<Redirector /> component anywhere in your app below the <Router> component from react-router.import {Redirector} from 'react-router-redirect';
const App = () =>(
<Router>
<React.Fragment>
<Redirector />
<Switch>
<Route exact path="/" component={Home}/>
</Switch>
</React.Fragment>
</Router>
)
import {push} from 'react-router-redirect';
class TestComponent extends React.Component {
onClick = () => {
push("/login")
}
render() {
return <button onClick={this.onClick}>Go to login</button>
}
}
import { push } from 'react-router-redirect'; // or import replace, go, goForward, goBack
import client from 'client';
import clientLoginMutation from 'gql/mutations/clientLogin';
const sagas = [
{
saga: 'MUTATION.LOGIN.SUCESS',
handler: ({ login }) => {
client
.mutate({ mutation: clientLoginMutation, variables: { user: login } })
.then(() => {
push('/dashboard');
});
}
}
];
export default sagas;
import {replace} from 'react-router-redirect';
push("/")
class TestComponent extends React.Component {
The module has all the methods available in React Router history property
FAQs
Push and replace routes anywhere
We found that react-router-redirect 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.