I don’t want to use React.component. Is there an equivalente of $f7ready in plain js?
I tried to get Framework7.instance (i.e. getInstance() ) but the “on” method is working
only for the serviceworker not for the application init.
Any suggestion?
export default () => {
useEffect(() => {
// not woking
getInstance().on('init', () => {
console.log('f7 init');
});
// not woking
getInstance().on('ready', () => {
console.log('f7 ready');
});
// works!
getInstance().on('serviceWorkerRegisterSuccess', () => {
console.log('f7 serviceWorkerRegisterSuccess');
});
}, []);
return (
<App params={f7params}>
<Statusbar/>
<View id="main-view" url="/" main className="safe-areas" pushState={true}/>
</App>
);
}