How to get the propTypes? of package components by react High-level components

problem description

currently, you need to do a HOC component debugging tool. If you select a component wrapped by HOC, there will be a selected box and a floating layer to prompt the component data. If there is a propTypes, make some warnings and prompts. During the development of
, it is found that all propTypes fetches are func.

related codes

const HOC = (Ele) => class extends Component{
    render() {
        console.log(Ele.propTypes)
        return <Ele {...this.props} />
    }
}

what result do you expect? What is the error message actually seen?

clipboard.png

Aug.31,2021

in fact, it is already a function

.

suppose you use the propTypes module.
Let's take propTypes.string as an example. We can look at the source code:

export default {

  string: createPrimitiveTypeChecker('string') // function

};

https://github.com/aackerman/.

The

function really works when the component accepts the prop and passes the prop accepted by the component to the function as an argument.

https://github.com/facebook/r.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c28e-2c2d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c28e-2c2d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?