I am totally new to HOC.
I have one custom component where I am calling react in built component.
e.g suppose "ABC" is my custom component and "XYZ" react npm package installed in my project And I am importing "XYZ" in class "ABC".
Whatever I am passing to "XYZ" as props, I need to use it in custom "ABC" component. Is it possible with HOC??
e.g
...
import XYZ from "react npm package";
import ActionProvider from './ActionProvider';
class ABC extends React.Component{
<XYZ actionProvider={ActionProvider} />
}
export default ABC;
........
ActionProvider is simple js file(it is not a react component). I need to call 1 method from action provider in ABC. But not able to call. Making that method static will not solve my problem because I need to use this object the method which I want to call.
Help me out if anyone knows the solution.
I am totally new to HOC.
I have one custom component where I am calling react in built component.
e.g suppose "ABC" is my custom component and "XYZ" react npm package installed in my project And I am importing "XYZ" in class "ABC".
Whatever I am passing to "XYZ" as props, I need to use it in custom "ABC" component. Is it possible with HOC??
e.g
...
import XYZ from "react npm package";
import ActionProvider from './ActionProvider';
class ABC extends React.Component{
}
export default ABC;
........
ActionProvider is simple js file(it is not a react component). I need to call 1 method from action provider in ABC. But not able to call. Making that method static will not solve my problem because I need to use this object the method which I want to call.
Help me out if anyone knows the solution.