Answers for "nextjs update ui when data is updated"

0

nextjs update ui when data is updated

JS
import { useRouter } from 'next/router';
function SomePage(props) {
  const router = useRouter();
  // Call this function whenever you want to
  // refresh props!
  const refreshData = () => {
    router.replace(router.asPath);
  }
}
export async function getServerSideProps(context) {
  // Database logic here
}
Posted by: Guest on March-05-2022

Code answers related to "nextjs update ui when data is updated"

Code answers related to "Javascript"

Browse Popular Code Answers by Language