Back to Clerk

`WithUser` component removed

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

latest440 B
Original Source

The WithUser 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 WithUser = ({ children }) => {
  const user = useUser();
  if (typeof children !== 'function') throw new Error();

  return {children(user)};
};