main
Branches
main (2.15.1)dev
Versions
2.15.11.19.3v0.21.0
React Router v7 has been released. View the docs
useOutletContext

useOutletContext

Convenience API over React Context that returns the context value from the closest parent <Outlet context={val} /> component.

import { useOutletContext } from "@remix-run/react";

function Child() {
  const myValue = useOutletContext();
  // ...
}

Additional Resources

Docs and examples licensed under MIT