Skip to content

Commit

Permalink
feat: export PropTypes as top-level API
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed May 31, 2018
1 parent 83ba47c commit f45010f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/nerv/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
unstable_batchedUpdates,
isValidElement
} from './dom'
import { PropTypes } from './prop-types' // for React 15- compat

export {
Children,
Expand All @@ -35,7 +36,8 @@ export {
hydrate,
createFactory,
unstable_batchedUpdates,
version
version,
PropTypes
}

export default {
Expand All @@ -55,5 +57,6 @@ export default {
hydrate,
createFactory,
unstable_batchedUpdates,
version
version,
PropTypes
} as any
20 changes: 20 additions & 0 deletions packages/nerv/src/prop-types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { noop } from 'nerv-shared'

export const PropTypes = {
array: noop,
bool: noop,
func: noop,
number: noop,
object: noop,
string: noop,

any: noop,
arrayOf: noop,
element: noop,
instanceOf: noop,
node: noop,
objectOf: noop,
oneOf: noop,
oneOfType: noop,
shape: noop
}

0 comments on commit f45010f

Please sign in to comment.