Framework7 with React Hooks

Hi guys. I have a doubt. React 16.8 added the ability to use code-cleansing and simplifying Hooks, no longer requiring class specification. The question is: can I use React Hooks together with Framework7?
Thanks.

Yes, should be fine with hooks

2 Likes

How can I access the app instance when using the hooks?

https://framework7.io/react/react-component-extensions.html

Oh, sorry, I haven’t noticed this section:

Framework7 instance, f7ready method and theme can be imported directly from Framework7-React library. Device, Request and Support can be imported directly from Framework7 core library.

import { Device, Request, Support } from 'framework7';
import { f7, f7ready, theme } from 'framework7-react';

Works great! Thank you, Vladimir!

1 Like