rnrf-relay-renderer
rnrf-relay-renderer copied to clipboard
Does not pass on static functions
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.
@mikberg could u send a PR to address this issue?
@sibelius Yeah, embarrassed I didn't just do that in the first place. Will try to find time.