Created
September 2, 2018 01:43
-
-
Save developit/71072a9b421e7d3d15fdbd6935d1a313 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import preact from 'preact'; | |
import PropTypes from 'prop-types'; | |
// installs global prop type checking for app preact components | |
preact.options.vnode = vnode => { | |
let Component = vnode.nodeName; | |
if (Component.propTypes) { | |
PropTypes.checkPropTypes( | |
Component.propTypes, | |
vnode.attributes | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment