Skip to content

Conversation

@hipstersmoothie
Copy link

closes #9

enables:

<SweetAlert
  show={this.state.show}
  title="Demo"
  onConfirm={() => this.setState({ show: false })}
>
  SweetAlert in React
</SweetAlert>

or with react content enabled:

<SwalWithReactContent
  show={this.state.modal2}
> 
  <div>
    <h1>I am title</h1>
    <h2>I am subtitle</h2>
    <p>
      whatever elements you want
    </p>
  </div>
</SwalWithReactContent>

the surrounding div is necessary currently and i think it would require changes to sweetalert-react-content to remove. @zenflow

@hipstersmoothie
Copy link
Author

btw @alex-shamshurin the test seem to be failing on master as well

@hipstersmoothie
Copy link
Author

@alex-shamshurin I also think that we should just use sweetalert-react-content as part of the default swal instance. I feel like most users would want to be able to render react content as the default rather than having to go through a bunch of setup

@hipstersmoothie
Copy link
Author

How do you feel about making the title or the html required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable React children to be used as html on the sweetalert component

1 participant