Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Icon1 from '../ruta'
- import Icon2 from '../ruta'
- import Icon3 from '../ruta'
- import Icon4 from '../ruta'
- const Icons = {
- 'user-icon': Icon1,
- 'mobile-icon': Icon2,
- 'car-icon': Icon3,
- 'laptop-icon': Icon4,
- }
- export const IconComponent = (props) => {
- const { name } = props
- const Component = Icons[name]
- return <Component {...props} />
- }
- const Componente = () => (
- <div>
- <FieldComponent name="user-icon" />
- </div>
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement