Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-kinops-common
Advanced tools
Helpful components for developing Kinetic Kinops bundles with React.
yarn add react-kinops-common
Then you will want to include the shared reducers into your store:
import { reducers as kinopsReducers } from 'react-kinops-common';
// Change this in your store creation:
combineReducers({ ...reducers })
// To this:
combineReducers({ ...reducers, ...kinopsReducers })
There is a layout Redux module that allows you to know in your React code weather the browser is in mobile or desktop
mode. You will need to execute the following block of code with the store
object so it can begin dispatching layout
mode changes to Redux.
import { LayoutModule } from 'react-kinops-common';
const { createLayoutListeners } = LayoutModule;
createLayoutListeners(store);
Then you need to merge your sagas with the shared sagas:
import { sagas as kinopsSagas, combineSagas } from 'react-kinops-common';
// From this:
sagaMiddleware.run(sagas));
// To this:
sagaMiddleware.run(combineSagas([sagas, kinopsSagas]));
import 'react-kinops-common/styles/master.scss';
You will need to dispatch the LOAD_APP
action in one of your components, preferably the App
component in its componentWillMount
lifecycle:
import { KinopsModule } from 'react-kinops-common';
const { actions: kinopsActions } = KinopsModule;
export const class App extends Component {
componentWillMount() {
this.props.loadApp();
}
render() {
/* App content */
}
}
const mapDispatchToProps = {
loadApp: kinopsActions.loadApp,
};
export const AppContainer = connect(null, mapDispatchToProps)(App);
import { HeaderContainer, ToastsContainer, ModalFormContainer } from 'react-kinops-common';
// Example.
export const Layout = ({ handleSidebarToggle, sidebar }) =>
<div>
<ToastsContainer />
<ModalFormContainer />
<HeaderContainer hasSidebar toggleSidebarOpen={handleSidebarToggle} />
</div>;
You will need to follow all of the steps above so that the Redux store, Sagas, and component are all loaded and ready. To display a toast you only need to dispatch the action.
import { ToastsModule } from 'react-kinops-common';
const { actions } = ToastsModule;
const mapDispatchToProps = {
addError: actions.addError,
};
class View extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.props.addError('This was clicked');
}
render() {
return (
<div>
<button onClick={handleClick}>Click Me!</button>
</div>
);
}
}
export const ViewContainer = connect(null, mapDispatchToProps)(View);
FAQs
Utilities and components for development with React and Kinops
The npm package react-kinops-common receives a total of 2 weekly downloads. As such, react-kinops-common popularity was classified as not popular.
We found that react-kinops-common 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.