
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@abak/react-context-toolkit
Advanced tools
Hey everyone! 😃, so this is my first open-source package that helps React developers work with React-Context. As you know, implementing an optimal context may take a lot of time or make our code dirty, although there are those who claim that there is no problem with this but the readability and extensibility of the code is a priority :)
There is an axios instance constructor so you can use it and have multiple controls with additional functions.
Install react-context-toolkit with npm
npm install @abak/react-context-toolkit
Next, we need to import the ContextToolkitInitializer into the component that is the parent of all the components we want to use the context inside:
import { ContextToolkitInitializer } from '@abak/react-context-toolkit'
function TheParentComponent() {
return (
<ContextToolkitInitializer
initialState={{ key: "value", key2: { key3: "value" } }} //[REQUIRED] your initial state
reducer={{ // [OPTIONAL]
key: (state, dispatch) => { // when you update { key: "" }
...your state updates
return state
},
key2Key3: (state, dispatch) => { // when you update { key2: { key3: "" } }
...your state updates
return state
}
}}
customFunctions={(dispatch, state) => ({ // [OPTIONAL] these functions will merge or overwrite on built-in functions that React Context Toolkit makes.
key2: {
updateSomething: (key, value) => {
dispatch({
type: "keyName", // [REQUIRED] the type name what will use in reducer key.
...else
})
}
}
})}
>
your things...
</ContextToolkitInitializer>
)
}
and, in your nested components:
import { useReactContextToolkit } from "@abak/react-context-toolkit";
function TheChildComponent() {
const { functions, dispatch, state } = useReactContextToolkit();
const onClickHander = () => {
functions.key2.update("keyName", keyValue);
// or
functions.key2.update({
keyName: keyValue,
keyName2: keyValue2,
keyName3: keyValue3,
});
// your custom function
functions.key2.updateSomething("keyName", keyValue);
};
return <button onClick={onClickHandler}>click me</button>;
}
Contributions are always welcome!
FAQs
a couple of tools to work with React Context
We found that @abak/react-context-toolkit 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.