[](https://www.npmjs.com/package/force2update?activeTab=versions) [](https://www.npm
npm install useforceupdatefromanywhere


React hooks for force updating Components from anywhere by others Components.
Force update from anywhere to those using a useForceUpdate hook with optional payload.
only pass component's name (it must be uniqe name) and one main object that has one function by name "forceName" without any implementation. after that in other Componete you can use mainObject.forceUpdate(componentName) and that Component going to update :)
bashnpm i useForceUpdateFromAnywhere
`Usage example
$3
`jsx
import { useForceUpdateFromAnywhere } from "useforceupdatefromanywhere"function App(mainObject) {
return (
)
}
function Component1(mainObject) {
useForceUpdateFromAnywhere(mainObject, 'componentName1');
return (
)
}function Component2(mainObject) {
useForceUpdateFromAnywhere(mainObject, 'componentName2');
return (
)
}
``