Skip to content

Commit ce2bc1e

Browse files
feat(internal): Change UIView from arrow to Component Class
1 parent 4c2157c commit ce2bc1e

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/components/UIView.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,19 @@ class View extends Component<UIViewProps, UIViewState> {
268268
}
269269
}
270270

271-
export const UIView = props => (
272-
<UIRouterConsumer>
273-
{router => (
274-
<UIViewConsumer>{parentUIView => <View {...props} router={router} parentUIView={parentUIView} />}</UIViewConsumer>
275-
)}
276-
</UIRouterConsumer>
277-
);
271+
export class UIView extends React.Component {
272+
static displayName = 'UIView';
273+
static __internalViewComponent: React.ComponentClass<UIViewProps> = View;
278274

279-
(UIView as any).displayName = 'UIView';
280-
(UIView as any).__internalViewComponent = View;
275+
render() {
276+
return (
277+
<UIRouterConsumer>
278+
{router => (
279+
<UIViewConsumer>
280+
{parentUIView => <View {...this.props} router={router} parentUIView={parentUIView} />}
281+
</UIViewConsumer>
282+
)}
283+
</UIRouterConsumer>
284+
);
285+
}
286+
}

0 commit comments

Comments
 (0)