New app, super beginner: error f7.dialog is undefined

Hi guys, i’m a super beginner with Framework7 and React. I’m trying to create a super easy app but I can’t move on.

this is the basic structure:
index.js

import React from 'react';
import ReactDOM from 'react-dom';
import Framework7 from 'framework7/framework7-bundle';
import Framework7React from 'framework7-react';
import App from './App';
import 'framework7/framework7-bundle.css';

Framework7.use([Framework7React]);

ReactDOM.render(
    React.createElement(App),
    document.getElementById('app')
);

App.js

import React from 'react';
import {App, View} from 'framework7-react';
import Login from './Login.js';
import Home from "./Home";
import Planning from "./Planning/Planning";

const f7params = {
  name: "IrideWEB Mobile",
  id: 'com.rietectecnici.iride',
  routes: [
      {
          path: '/login/',
          component: Login
      },
      {
          path: '/home/',
          component: Home
      },
      {
          path: "/planning-ord/:date/",
          component: Planning
      },
      {
          path: "/planning-extra/:date/",
          component: Planning
      },
  ]
}

const username = localStorage.getItem("username");
const token = localStorage.getItem("access_token");

const app = () => (
    <App {...f7params}>
        <View main url={username && token ? "/login/" : "/login/"} />
    </App>
);

export default app;

Login.js

import React from 'react';
import {
    Page,
    Block,
    BlockTitle,
    List,
    NavTitle,
    Navbar, ListInput, ListButton,
    f7,
} from 'framework7-react';
import axios from "axios";
import qs from "qs";
import IWAjax from "./IWAjax";
import Config from "./Config";


class Login extends React.Component{
    constructor(props) {
        super(props);
        this.state = {
            username: "",
            password: ""
        };

        this.handleInputChange = this.handleInputChange.bind(this);
    }

    handleClick({f7router}){
        const config = new Config();
        const self = this;
        console.log(this);
        const formData1 =  {
            username: self.state.username,
            password: self.state.password,
            codicecliente: config.codicecliente
        };
        axios({
            method: 'POST',
            headers: { 'content-type': 'application/x-www-form-urlencoded' },
            data: qs.stringify(formData1),
            url: config.iride_url + "/ajax.php?JSON=1&object=IWUser&tipoview=login"
        }).then(res => res.data.ret === "true").then(function(ret){
            if(!ret)
            {
                f7.dialog.alert("Credenziali Errate");
                return false;
            }
            localStorage.setItem("username", self.state.username);

            IWAjax({
                app: f7,
                route: "getRietecAppCredenziali",
                success: function (res) {
                    return f7router.navigate("/home/");
                }
            });
        })
    }

    handleInputChange(event){
        const target = event.target;
        const value = target.type === 'checkbox' ? target.checked : target.value;
        const name = target.name;

        this.setState({
            [name]: value
        });
    }

    render() {
        return (
            <Page name="login">
                <Navbar>
                    <NavTitle>IrideWeb</NavTitle>
                </Navbar>
                <Block>
                    <BlockTitle>Area Riservata</BlockTitle>

                        <List noHairlinesMd>
                            <ListInput
                                type="text"
                                placeholder="Username"
                                name="username"
                                clearButton
                                onChange={this.handleInputChange}
                            />
                            <ListInput
                                type="password"
                                placeholder="Password"
                                name="password"
                                clearButton
                                onChange={this.handleInputChange}
                            />
                        </List>
                        <List inset>
                            <ListButton title="Login" type="submit" onClick={this.handleClick.bind(this)}/>
                        </List>

                </Block>
            </Page>

When I’m trying to login and it fails instead of opening the popup i receive an error:
Unhandled Rejection (TypeError): framework7_react__WEBPACK_IMPORTED_MODULE_1__.f7.dialog is undefined

Can you tell me please why? Thanks!

I’ve tested another situation, with the same index.js and App.js I’ve tried to launch a demo page from documentation, the progress bar page:

import React, { useRef } from 'react';
import {
    Page,
    Navbar,
    Block,
    BlockTitle,
    Progressbar,
    Segmented,
    Button,
    List,
    ListItem,
    f7,
} from 'framework7-react';

export default () => {
    const determinateLoading = useRef(false);
    const infiniteLoading = useRef(false);

    console.log(f7);

    const setInlineProgress = (value) => {
        f7.progressbar.set('#demo-inline-progressbar', value);
    };
    const showDeterminate = (inline) => {
        if (determinateLoading.current) return;
        determinateLoading.current = true;
        let progressBarEl;
        if (inline) {
            progressBarEl = f7.progressbar.show('#demo-determinate-container', 0);
        } else {
            progressBarEl = f7.progressbar.show(0);
        }
        let progress = 0;
        function simulateLoading() {
            setTimeout(() => {
                const progressBefore = progress;
                progress += Math.random() * 20;
                f7.progressbar.set(progressBarEl, progress);
                if (progressBefore < 100) {
                    simulateLoading(); // keep "loading"
                } else {
                    determinateLoading.current = false;
                    f7.progressbar.hide(progressBarEl); // hide
                }
            }, Math.random() * 200 + 200);
        }
        simulateLoading();
    };
    const showInfinite = (multiColor) => {
        if (infiniteLoading.current) return;
        infiniteLoading.current = true;
        if (multiColor) {
            f7.progressbar.show('multi');
        } else {
            f7.progressbar.show();
        }
        setTimeout(() => {
            infiniteLoading.current = false;
            f7.progressbar.hide();
        }, 3000);
    };
    return (


        <Page>
            <Navbar title="Progress Bar"></Navbar>
            <Block>
                <p>
                    In addition to <a href="/preloader/">Preloader</a>, Framework7 also comes with fancy
                    animated determinate and infinite/indeterminate progress bars to indicate some
                    activity.
                </p>
            </Block>
            <BlockTitle>Determinate Progress Bar</BlockTitle>
            <Block strong>
                <p>
                    When progress bar is determinate it indicates how long an operation will take when the
                    percentage complete is detectable.
                </p>
                <p>Inline determinate progress bar:</p>
                <div>
                    <p>
                        <Progressbar progress={10} id="demo-inline-progressbar" />
                    </p>
                    <Segmented raised>
                        <Button
                            onClick={() => {
                                setInlineProgress(10);
                            }}
                        >
                            10%
                        </Button>
                        <Button
                            onClick={() => {
                                setInlineProgress(30);
                            }}
                        >
                            30%
                        </Button>
                        <Button
                            onClick={() => {
                                setInlineProgress(50);
                            }}
                        >
                            50%
                        </Button>
                        <Button
                            onClick={() => {
                                setInlineProgress(100);
                            }}
                        >
                            100%
                        </Button>
                    </Segmented>
                </div>
                <div>
                    <p>Inline determinate load & hide:</p>
                    <p id="demo-determinate-container"></p>
                    <p>
                        <Button
                            fill
                            onClick={() => {
                                showDeterminate(true);
                            }}
                        >
                            Start Loading
                        </Button>
                    </p>
                </div>
                <div>
                    <p>Overlay with determinate progress bar on top of the app:</p>
                    <p>
                        <Button
                            fill
                            onClick={() => {
                                showDeterminate(false);
                            }}
                        >
                            Start Loading
                        </Button>
                    </p>
                </div>
            </Block>
            <BlockTitle>Infinite Progress Bar</BlockTitle>
            <Block strong>
                <p>
                    When progress bar is infinite/indeterminate it requests that the user wait while
                    something finishes when it’s not necessary to indicate how long it will take.
                </p>
                <p>Inline infinite progress bar</p>
                <p>
                    <Progressbar infinite />
                </p>
                <p>Multi-color infinite progress bar</p>
                <p>
                    <Progressbar infinite color="multi" />
                </p>
                <div>
                    <p>Overlay with infinite progress bar on top of the app</p>
                    <p id="demo-infinite-container"></p>
                    <p>
                        <Button
                            fill
                            onClick={() => {
                                showInfinite(false);
                            }}
                        >
                            Start Loading
                        </Button>
                    </p>
                </div>
                <div>
                    <p>Overlay with infinite multi-color progress bar on top of the app</p>
                    <p>
                        <Button
                            fill
                            onClick={() => {
                                showInfinite(true);
                            }}
                        >
                            Start Loading
                        </Button>
                    </p>
                </div>
            </Block>
            <BlockTitle>Colors</BlockTitle>
            <List simpleList>
                <ListItem>
                    <Progressbar color="blue" progress={10} />
                </ListItem>
                <ListItem>
                    <Progressbar color="red" progress={20} />
                </ListItem>
                <ListItem>
                    <Progressbar color="pink" progress={30} />
                </ListItem>
                <ListItem>
                    <Progressbar color="green" progress={80} />
                </ListItem>
                <ListItem>
                    <Progressbar color="yellow" progress={90} />
                </ListItem>
                <ListItem>
                    <Progressbar color="orange" progress={100} />
                </ListItem>
            </List>
        </Page>


    );
};

The rendering of the page is perfect, but when I click a button and f7.progress bar is called i receive this:

TypeError: framework7_react__WEBPACK_IMPORTED_MODULE_1__.f7.progressbar is undefined

Where do I have to import that progressbar component (or dialog in the previous case)?

Thanks

Are you using latest F7 v6? Make sure you created an app using latest version of F7-CLI Framework7 Command-Line Interface

No I haven’t used that client! I’m trying now to work on a single page template installed ith that client, thanks for the tip!

Definetely better with the F7-CLI, thanks!