Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React children #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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