How to make a dialog in V3 and React?


#1

Hello,

I don’t find Dialog in the React V3 doc.

How to do prompt, alert, etc… ?


#2

In the Vue, too, not everything is in the docs. Perhaps some components is in development or the developer decided that it is not necessary. For my cases I use a standard api or write my own component. For the Dialog, this is more a method than a component.


#3

Correct, if no component in Vue/React docs then there is no such, just use core F7 api for such components


#4

It is just a bit confusing because a Dialog menu exists in the core documentation and no other part of the React documentation mentions it.

But there was an example in the kitchen-sink, so I figured out.

For interested future readers, this is what I did :

export default class extends React.Component {
  constructor(props) {
    super(props);
  }

  openAlert = () => {
    const app = this.$f7;
    app.dialog.alert("Hello!");
  }

  render() {
    return (
      <Page>
        <Block strong>
          <Button raised className="col" onClick={this.openAlert}>
            Alert
          </Button>