Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
How to use React Icons with an icon inside the tag

I'm trying to use react icons without import the icon of the lib. Is it possible to call the icon and pass the name like <Icon name="FiMenu" /> or <Icon name="FiArrowRight" />?

Nothing happened, looks like property Icon does not exists from react-icons.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

There is no such component called Icon in the library or in React so you do need to individually import the components.

Follow the documentation: https://github.com/react-icons/react-icons The basic usage is:

import { FaBeer } from 'react-icons/fa';

class Question extends React.Component {
  render() {
    return <h3> Lets go for a <FaBeer />? </h3>
  }
}

If you really want to understand what is happening I suggest having a look through the source code.

about 4 years ago · Juan Pablo Isaza Denunciar

0

The not best practice, but you can also create oan object with key (name of icon) and value the icon. So after this import of your icons. Example:

import {FaBeer} from "react-icons/fa"
const icons = {
  "FaBeer": FaBeer
}
export const Icon ({name, ...props} ) => {
  const IconComponent = icons[name]
  return <IconComponent {...props} />
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda