
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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 5 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.