mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Fixed an issue with infinite rerendering on app routes by making it a Pure component. Adds `why-did-you-render` for development use. Co-authored-by: Taso <[email protected]>
15 lines
340 B
TypeScript
15 lines
340 B
TypeScript
import { memo, useEffect } from 'react';
|
|
import { useNuiRequest } from 'fivem-nui-react-lib';
|
|
|
|
const Component = ({ children, id }) => {
|
|
const Nui = useNuiRequest();
|
|
useEffect(() => {
|
|
Nui.send(`npwd:app:${id}`);
|
|
}, [Nui, id]);
|
|
return children;
|
|
};
|
|
|
|
const AppWithStartup = memo(Component, () => true);
|
|
|
|
export { AppWithStartup };
|