react-activation
react-activation copied to clipboard
error with nextjs14
ERROR : Uncaught Error: Super expression must either be null or a function when using react-activation in
"next": "14.2.5", "react-activation": "^0.13.0", reactStrictMode: false,
MY CODE:
//app/h5/_components/KeepAliveWrapper.tsx 'use client';
import React from 'react'; import KeepAlive from 'react-activation';
export default function LayoutWrapper({ children }: Readonly<{ children: React.ReactNode; }>) { return <KeepAlive>{children}</KeepAlive>; }
// app/h5/layout.tsx import React from 'react'; import { AliveScope } from 'react-activation';
import KeepAliveWrapper from './_components/KeepAliveWrapper';
export default function Layout({ children }: Readonly<{ children: React.ReactNode; }>) { return ( <AliveScope> <KeepAliveWrapper>{children}</KeepAliveWrapper> </AliveScope> ); }
// app/layout.tsx 'use server';
export default async function RootLayout({ children }: Readonly<{ children: React.ReactNode; }>) { return (