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

381
Vistas
React does not recognize the `buttonType` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute++

I get this error:

React does not recognize the buttonType prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase buttontype instead. If you accidentally passed it from a parent component, remove it from the DOM element.

and I can't get rid of this for some reason, no I don't want to use props. I want this to be a separate property, the app works fine, but I get this message in the console. What am I doing wrong? this is my component.

    import React, { useState } from 'react';
import styles from './genericbutton.module.scss';
import classnames from 'classnames/bind';

interface GenericButtonProps {
  text: string;
  action: any;
  type: string;
  props?: any;
  buttonType?: string;
}

const GenericButtonComponent: React.FC<GenericButtonProps> = ({
  text,
  action,
  type,
  props,
  buttonType = 'primary',
}) => {
  const [isOverButton, setIsOverButton] = useState(false);

  const cx = classnames.bind(styles);
  const buttonClassnames = cx('button', {
    effect: isOverButton,
    primary: buttonType === 'primary',
    secondary: buttonType === 'secondary',
    tertiary: buttonType === 'tertiary',
  });

  const toggleEffect = () => {
    setIsOverButton(!isOverButton);
  };

  return (
    <button
      onClickCapture={toggleEffect}
      className={buttonClassnames}
      type={type}
      onClick={action}
      {...props}
      buttonType={buttonType}
    >
      {text}
    </button>
  );
};

export default GenericButtonComponent;

and this is how I use my component in another component:

const renderSection = (childrenButtons: ButtonObj[]) => {
  return childrenButtons.map((childrenButton: ButtonObj) => (
    <GenericButtonComponent
      text={childrenButton.title}
      action={childrenButton.action}
      key={childrenButton.title}
      props={childrenButton.props}
      type="submit"
    />
  ));
};

const GenericTableComponent: React.FC<Props> = ({ section, childrenButtons }) => {
  return (
    <div className={`${styles.container} ${styles.center}`}>
      <LabelComponent content={section} size="medium" />
      {renderSection(childrenButtons)}
    </div>
  );
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

thanks it was fixed with lowercase! yes I need it to change the styles based on the input i get

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