Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Icon1 from '../ruta'
  2. import Icon2 from '../ruta'
  3. import Icon3 from '../ruta'
  4. import Icon4 from '../ruta'
  5.  
  6. const Icons = {
  7.   'user-icon': Icon1,
  8.   'mobile-icon': Icon2,
  9.   'car-icon': Icon3,
  10.   'laptop-icon': Icon4,
  11. }
  12.  
  13. export const IconComponent = (props) => {
  14.   const { name } = props
  15.   const Component = Icons[name]
  16.   return <Component {...props} />
  17. }
  18.  
  19. const Componente = () => (
  20.   <div>
  21.     <FieldComponent name="user-icon" />
  22.   </div>
  23. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement