Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

386
Visualizações
npm @material-ui/core Button and TexField not working

I am building a React application and I wanted to use the material-ui framework.

I build a component with a textfield and a button but I can`t click the textfield neither the button their blocked.

Here is the component code:

import React, { Component } from 'react';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';


class Descarcare extends React.Component {
constructor(props) {
  super(props);
  this.state = {  };
 
}



render() {
   return(
<div>
<h1>Descarcare</h1>

<TextField id="standard-required" label="ID" InputProps={{
        readOnly: false,
      }}/>
<Button variant="contained" color="primary">
Trimite
</Button>
</div>
   );
}

 }

export default Descarcare;

The component appears in the browser but I can`t press the button it is blocked and so is the input field. I can not write anything in it. Can please someone help me ? Thanks in advance

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

You have to provide the onClick and onChange functions respectively.

about 4 years ago · Juan Pablo Isaza Relatório

0

It might be related to your other configs, You could have a reference to this example:

Edit Material demo (forked)

about 4 years ago · Juan Pablo Isaza Relatório

0

In React you got to control inputs see here as for the material-ui library buttons default to disable if no onClick is provided (if I recall correctly) and text fields need value and onChange to react! hope it is helpfull

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda