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

236
Visualizações
How to display the function result in the table after pressing the button?

I created a table, button and input using chakra ui. I want the function executed after "onClick" to display its result in a table. My main problem is the use of useState (). I'm not sure if I'm doing it right. There is no attempt to "enter" the function result into the table in the code. When I tried such solutions, the web application did not load. Please help

  Moralis.start({ serverUrl, appId, masterKey });

  const query2 = new Moralis.Query('SpaceMissionsStarted');

  const [inputValue, setInputValue] = useState('');

  const tableRow = document.getElementById('event');

  function findAddress() {
    const query2 = new Moralis.Query('SpaceMissionsStarted');
    query2.equalTo('senderAddress', inputValue);
  }

  return (
    <ChakraProvider theme={theme}>
      <Box textAlign="center" fontSize="xl">
        <TableContainer>
          <Table
            variant="striped"
            colorScheme="telegram"
            size="sm"
            mt={5}
            maxW="500px"
            ml={300}
          >
            <TableCaption>
              SpaceMission Started Events Query Finder
            </TableCaption>
            <Thead>
              <Tr>
                <Th>Event name</Th>
                <Th>into</Th>
                <Th isNumeric>multiply by</Th>
              </Tr>
            </Thead>
            <Tbody>
              <Tr>
                <Td>...</Td>
                <Td>...)</Td>
                <Td isNumeric>...</Td>
              </Tr>
              <Tr>
                <Td>...</Td>
                <Td>..</Td>
                <Td isNumeric>...</Td>
              </Tr>
            </Tbody>
            <Tfoot>
              <Tr>
                <Th>Event name</Th>
                <Th id="event"></Th>
                <Th isNumeric>..</Th>
              </Tr>
            </Tfoot>
          </Table>
        </TableContainer>
        <Input
          placeholder="address"
          maxWidth="300px"
          onChange={e => setInputValue(e.target.value)}
        />
        <Button
          colorScheme="telegram"
          ml={50}
          onClick={findAddress}
          id="button"
        >
          Find
        </Button>
      </Box>
    </ChakraProvider>
about 4 years ago · Santiago Gelvez
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