Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fusion-react-async#115] React.forwardRef breaks SSR on prepare #287

Open
chrisdothtml opened this issue May 9, 2019 · 0 comments
Open

Comments

@chrisdothtml
Copy link
Member

chrisdothtml commented May 9, 2019

This issue was migrated from fusionjs/fusion-react-async#115 and was originally reported by @rynocouse.


Type of issue

bug

Description

When wrapping a stateless component in a React.forwardRef SSR breaks on prepare.

Current behavior

Error:

TypeError: type is not a function
[36m at prepareElement node_modules/fusion-react-async/src/prepare.js:59:29�

Component:

const Slide = React.forwardRef((props: Props, ref) => {
  return (
     <Styled.SlideOpacity
       $active={props.active}
       $leavingActive={props.leavingActive}
       $ref={ref}
    >
       {props.children}
    </Styled.SlideOpacity>
   );
});

Expected behavior

Wrapping stateless component in React.forwardRef should render SSR without an error.
React Docs - Forwarding Refs

Steps to reproduce

  1. Wrap a stateless component in React.forwardRef
  2. Reload page

Your environment

  • fusion-react-async version: 1.2.3

  • Node.js version: v8.11.3

  • npm version: 5.6.0

  • Operating System: OSX 10.13.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant