managerial-maroonM
Refine2y ago
4 replies
managerial-maroon

CanAccess usage recommendation

Is it bad to use the CanAccess component in the _app.tsx file?

function MyApp({ Component, pageProps }: AppPropsWithLayout): JSX.Element {
// ...
    return (
      <ThemedLayoutV2
        Header={() => <Header sticky />}
        Sider={(props) => <ThemedSiderV2 {...props} fixed />}
        Title={({ collapsed }) => (
          <ThemedTitleV2
            collapsed={collapsed}
            text={<Image preview={false} src="/images/energia_premiada.png" />}
            icon={null}
          />
        )}
      >
        <CanAccess> 
          <Component {...pageProps} />
        </CanAccess>
      </ThemedLayoutV2>
    );
  };
Was this page helpful?