Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
flux-router-component
Advanced tools
Router-related React component and mixin for applications with Flux architecture
This package provides navigational React components and router React mixin for applications built with Flux architecture. Please check out examples of how to use these components.
NavLink
is the a React component for navigational links. When the link is clicked, NavLink will dispatch NAVIGATE
action to flux dispatcher. The dispatcher can then dispatch the action to the stores that can handle it.
var NavLink = require('flux-router-component').NavLink;
var Nav = React.createClass({
render: function () {
var pages,
links,
context = this.props.context; // this should have a router instance and an executeAction function
pages = [
{
name: 'home',
url: '/home',
text: 'Home'
},
{
name: 'about',
url: '/about',
text: 'About Us'
}
];
links = pages.map(function (page) {
return (
<li className="navItem">
<NavLink href={page.url} context={context}>
{page.text}
</NavLink>
</li>
);
});
return (
<ul className="nav">
{links}
</ul>
);
}
});
RouterMixin
is a React mixin to be used by application's top level React component to:
CHANGE_ROUTE_START
and CHANGE_ROUTE_SUCCESS
or CHANGE_ROUTE_FAILURE
events via flux dispatcher on window popstate
eventsvar RouterMixin = require('flux-router-component').RouterMixin;
var Application = React.createClass({
mixins: [RouterMixin],
...
});
This library supports browsers without native pushState, such as IE8 and IE9. For these old browsers, hash will be updated with the new route path. Here is an example:
User clicks on a link to navigate from the current route http://mydomain.com/home
, to a new route http://mydomain.com/path/to/new/route
:
http://mydomain.com/home#/path/to/new/route
.addEventListener
and removeEventListener
polyfills are provided by:
This software is free to use under the Yahoo! Inc. BSD license. See the LICENSE file for license text and copyright information.
Third-pary open source code used are listed in our package.json file.
FAQs
Router-related React component and mixin for applications with Fluxible architecture
We found that flux-router-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.