Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
preact-router
Advanced tools
Connect your Preact components up to that address bar.
preact-router
provides a <Router />
component that conditionally renders its children when the URL matches their path
. It also includes a convenient <Link />
component as a drop-in replacement for <a />
wired up to the router.
import Router from 'preact-router';
import { h } from 'preact';
/** @jsx h */
const Main = () => (
<Router>
<Home path="/" />
<About path="/about" />
<Search path="/search/:query" />
</Router>
);
render(<Main />, document.body);
:information_desk_person: Pages are just regular components that get mounted when you navigate to a certain URL.
Any URL parameters get passed to the component as props
.
Defining what component(s) to load for a given URL is easy and declarative.
You can even mix-and-match URL parameters and normal props
.
<Router>
<A path="/" />
<B path="/b" id="42" />
<C path="/c/:id" />
<D default />
</Router>
FAQs
Connect your components up to that address bar.
The npm package preact-router receives a total of 13,936 weekly downloads. As such, preact-router popularity was classified as popular.
We found that preact-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.