MCPcopy Index your code
hub / github.com/vercel/hyper / DecoratedComponent

Class DecoratedComponent

lib/utils/plugins.ts:74–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 Component_: React.ComponentType<P>
73): React.ComponentClass<P, unknown> {
74 return class DecoratedComponent extends React.Component<P> {
75 constructor(props: P, context: any) {
76 super(props, context);
77 }
78 onRef = (decorated_: any) => {
79 if (this.props.onDecorated) {
80 try {
81 // eslint-disable-next-line @typescript-eslint/no-unsafe-call
82 this.props.onDecorated(decorated_);
83 } catch (e) {
84 notify('Plugin error', `Error occurred. Check Developer Tools for details`, {error: e});
85 }
86 }
87 };
88 render() {
89 return React.createElement(Component_, Object.assign({}, this.props, {ref: this.onRef}));
90 }
91 };
92}
93
94function getDecorated<P extends Record<string, any>>(

Callers

nothing calls this directly

Calls 1

notifyFunction · 0.70

Tested by

no test coverage detected