Skip to content

Instantly share code, notes, and snippets.

@frivolta
Created May 27, 2022 15:41
Show Gist options
  • Save frivolta/d795cc6e4fa16be8ca8d88f07eb0da0e to your computer and use it in GitHub Desktop.
Save frivolta/d795cc6e4fa16be8ca8d88f07eb0da0e to your computer and use it in GitHub Desktop.
Write better React, compose multiple functional HoCs, Higher-Order Components - HoC
export const withTitle = (Component) => (props) => {
const title = "Custom title";
return <Component title={title} {...props} />;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment