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

324
Visualizações
Does props.[Name](value) send the value to the parent in order for it to be used?

Currently following a guide right now to learn React and HTML and I'm at this part where we create a filter drop down and pass the selected item to the parent of it.

In the filter js file I have :

const dateFilterHandler = (event) => {
    props.onChangeFilter(event.target.value);
}

and in the parent file, I have

const [filteredYear, setFilteredYear] = useState('2020')
const filterChangeHandler = selectedYear => {
    setFilteredYear(selectedYear);
};

  const dateFilterHandler = (selectedYear) => {
    console.log("Expenses.js");
    console.log(selectedYear);
  };

Correct me if I'm wrong but is the child code, (filter) taking the value of the drop down and putting it into props, then the parent file is taking dateFilterHandler to use the value that was "lifted" up into it?

about 4 years ago · Juan Pablo Isaza
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