I am having an issue about use the 'KeepAlive' tag. It works well, the perfomance of my App increased so much and I really want to use it. But, sometimes the tab does not change. I am using Ionic Framework with React and building an App. Without the keepAlive, the App works very slowly and ALWAYS the tab change. But with the 'KeepAlive' tag it is faster, but I got this Bug: sometimes the tab does not change and sometimes change.
Here my code (I use it in another four tabs):
import { IonList } from '@ionic/react';
import Input from '../../../../../components/Input';
import PhoneNumber from './phoneNumber';
import KeepAlive from 'react-activation';
function Farmer() {
return (
<KeepAlive>
<IonList lines = 'none'>
<Input
title = { 'Nome' }
inputRepeats = { 1 }
placeholder = { 'Digite o nome do produtor' }
inputMode = { 'text' }
/>
<PhoneNumber />
<Input
title = { 'E-mail' }
inputRepeats = { 1 }
placeholder = { 'Digite o e-mail do produtor' }
inputMode = { 'email' }
/>
<Input
title = { 'Fazenda' }
inputRepeats = { 1 }
placeholder = { 'Digite o nome da fazenda' }
inputMode = { 'text' }
/>
</IonList>
</KeepAlive>
);
}
export default Farmer;
And here my code in index.js:
import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
import * as serviceWorkerRegistration from './serviceWorkerRegistration';
import reportWebVitals from './reportWebVitals';
import { AliveScope } from 'react-activation'
const container = document.getElementById('root');
const root = createRoot(container);
root.render(
<AliveScope>
<App />
</AliveScope>
);
serviceWorkerRegistration.unregister();
reportWebVitals();
How Can do I certificate my App will change the tab?
I am having an issue about use the 'KeepAlive' tag. It works well, the perfomance of my App increased so much and I really want to use it. But, sometimes the tab does not change. I am using Ionic Framework with React and building an App. Without the keepAlive, the App works very slowly and ALWAYS the tab change. But with the 'KeepAlive' tag it is faster, but I got this Bug: sometimes the tab does not change and sometimes change.
Here my code (I use it in another four tabs):
And here my code in index.js:
How Can do I certificate my App will change the tab?