Closed rafamel closed 5 years ago
It can't accept instance because instance to initiliaze requires app root element in DOM. So just make it globally when you need it, in app root component, e.g.:
componentDidMount() {
this.$f7ready((f7) => {
window.f7 = f7
});
}
Is your feature request related to a problem? Please describe. As only one F7 instance needs to be instantiated for the application, it would make sense to have it globally available (within and outside of React Components) without resorting to dirty tricks. I have personally encountered several situations in which this would have been very helpful in terms of simplifying the development of some of my app's features.
Describe the solution you'd like Allow the App component to take either the Framework7 parameters (as it currently does) or an instance to use instead. This will allow for a greater degree of flexibility, and would be simpler to implement than #3271 while still providing most of its value.
Describe alternatives you've considered I wonder whether creating and using an additional F7 instance to have globally available would have any side effects?