Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. function ExcludeProps(Component: any, filter: string[] = []) {
  2. return (props) => {
  3. const keys = Object.keys(props).filter(key => !filter.includes(key))
  4. const picked = lodash.pick(props, keys)
  5.  
  6. return <Component {...picked} />
  7. }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement