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

332
Visualizações
How to close a modal using class components in React and Sharetribe flex

I am working on a project in React and Sharetribe flex, and I am trying to make a Modal Popup when user Clickon button. Modal is opening for me but when I want to close it to "X" onCloseModal function is not closing my Modal. I wanted to know where the mistake lies, thanks in advance!!


export class EditListingAvailabilityFormComponent extends Component {
 
  state = {
    openModal: false,
  };
  onClickButton = e => {
    e.preventDefault();
    this.setState({ openModal: true});
  };
  onCloseModal = () => {enter code here
    this.setState({ openModal: false});
  };


<Button
                onClick={this.onClickButton}
                className={css.submitButton}
                type="submit"
                inProgress={submitInProgress}
                disabled={submitDisabled}
                ready={submitReady}
              >
                {saveActionMsg}
              </Button>

 <Modal open={this.state.openModal} onClose={this.onCloseModal}>
                    <h2> We would love to hear what you think! As we are constantly looking to improve
                    our processes we would love to hear from you how the listing & the onboarding
                    went! If you have 5 minutes to help us out we would be very grateful. Please

                    <a href="https://docs.google.com/forms/d/e/1FAIpQLScopkXx5GPFGrCpqKTBBNk4lUxzPaiVotAXIe_rlNN6oIIvBQ/viewform?usp=sf_link">
                      Click here
                    </a> here to proceed to the questionnaire.

                    
                    </h2>
                </Modal>   
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