0
2
llucycodes42
The code above creates a function that takes an object as a parameter. It then creates a WrappedComponent object that contains the properties of the object. Finally, the code adds a property to the WrappedComponent object that contains the propTypes for the object.
Library: react
Shortcut: hoc
import React from 'react'
import PropTypes from 'prop-types'
export default (WrappedComponent) => {
const hocComponent = ({ ...props }) => <WrappedComponent {...props} />
hocComponent.propTypes = {}
return hocComponent
}