Skip to content

Commit

Permalink
feat(shared): remove isValidElement types dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Apr 30, 2021
1 parent b1eab98 commit b649228
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
"build:esm": "tsc --declaration --module es2015 --outDir esm",
"build:umd": "rollup --config"
},
"peerDependencies": {
"@types/react": ">=16.8.0 || >=17.0.0"
},
"dependencies": {
"@formily/path": "2.0.0-beta.41",
"camel-case": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/checkers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const isNumberLike = (index: any): index is number =>
isNum(index) || /^\d+$/.test(index)
export const isObj = (val: unknown): val is object => typeof val === 'object'
export const isRegExp = isType<RegExp>('RegExp')
export const isReactElement = (obj: any): obj is React.ReactElement<any> =>
export const isReactElement = (obj: any): boolean =>
obj && obj['$$typeof'] && obj['_owner']
export const isHTMLElement = (target: any): target is EventTarget => {
return Object.prototype.toString.call(target).indexOf('HTML') > -1
Expand Down

0 comments on commit b649228

Please sign in to comment.