Back to Clerk

`WithSession` component removed

packages/upgrade/src/versions/core-2/common/withsession-removed.md

latest455 B
Original Source

The WithSession higher order component has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's custom hooks. An example of how to do so is below:

js
export const WithSession = ({ children }) => {
  const session = useSession();
  if (typeof children !== 'function') throw new Error();

  return {children(session)};
};