Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
react-pushstate-anchor
Advanced tools
React PushState Anchor provides three components for performing client-side push state navigation. There's no routing or complex state management. Just three components
<PushStateAnchorProvider />
Wrap your entire application or just the part of the application you want to use pushState in.
<PushStateAnchor />
A replacement for <a>
tags that will use history.pushState
under the hood.
import { PushStateAnchor as A } from 'react-pushstate-anchor'
<A href='/home'>Home</A>
PushStateLocation />
A utitlity component that will provide the current history location using a render callback.
import { PushStateLocaation } from 'react-pushstate-anchor'
<PushStateLocation>
{location => {
<h1>The current pathname is {location.pathname}</h1>
)}
</PushStateLocation>
Install from NPM:
yarn add react-pushstate-anchor
React PushState Anchor is written entirely in ES6 with React 16.3's context API.
We assume you're using Webpack or Rollup as you're using React, so we do no bundling whatsover
import React, { Component } from 'react'
import { PushStateAnchorProvider, PushStateLocation, PushStateAnchor as Psa } from 'react-pushstate-anchor'
class App extends Component {
render() {
return (
<PushStateAnchorProvider>
<h1>Push State Anchor</h1>
<Psa href='/home'><button>Home</button></Psa>
<Psa href='/about'><button>About</button></Psa>
<Psa href='/careers'><button>Careers</button></Psa>
<PushStateLocation>
{location => (
<h1>{location.pathname}</h1>
)}
</PushStateLocation>
</PushStateAnchorProvider>
)
}
}
export default App
react-pushstate-anchor
will render a simple <a>
anchor tag if JavaScript is unavailable.
FAQs
## What is it?
The npm package react-pushstate-anchor receives a total of 4 weekly downloads. As such, react-pushstate-anchor popularity was classified as not popular.
We found that react-pushstate-anchor 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.