How to create HOC for in built react component?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository file, test, or documentation entry point. First clarify whether a React HOC example or guidance about passing props and calling a method on ActionProvider is wanted; completion criteria are not specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100