Skip to content

Release v2.1.0

Compare
Choose a tag to compare
@Gelio Gelio released this 19 Apr 13:48
· 22 commits to master since this release

A minor release. Fixes a bug that caused named function expressions not to be detected properly in some cases.

Changelog

  • Describe a workaround for ambiguous function expressions in the README

  • Detect and allow using hooks inside named function expressions

    const withHoc = <TProps extends object>(Component: ComponentType<TProps>) =>
      function WrappedComponent(props: TProps) {
        // Naming the function expression allows using hooks
        const [state] = useState();
        return <Component {...props} />;
      };