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

Does not pass on static functions #12

Open
mikberg opened this issue Oct 13, 2016 · 2 comments
Open

Does not pass on static functions #12

mikberg opened this issue Oct 13, 2016 · 2 comments

Comments

@mikberg
Copy link

mikberg commented Oct 13, 2016

Awesome library! 👍

I'm trying to use RNRF's renderNavigationBar, which is a static function. This library currently doesn't pass on these static functions, which causes issues in situations like this.

A quickfix for my specific problem:

export default (moduleProps) => (Component) => {
  if (!Relay.isContainer(Component)) {
    return Component;
  }
  const fn = props => (
    <RelayComponentRenderer
      {...moduleProps}
      {...props}
      component={Component}
    />
  );

  fn.renderNavigationBar = Component.renderNavigationBar;

  return fn;
};

For a more complete solution, perhaps hoist-non-react-statics could be used.

@sibelius
Copy link
Contributor

@mikberg could u send a PR to address this issue?

@mikberg
Copy link
Author

mikberg commented Oct 18, 2016

@sibelius Yeah, embarrassed I didn't just do that in the first place. Will try to find time.

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

2 participants