We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4599fef commit 378121eCopy full SHA for 378121e
src/PagerView.tsx
@@ -233,3 +233,9 @@ export const PagerView = React.forwardRef<PagerViewInternal, PagerViewProps>(
233
return <PagerViewInternal {...rest} useLegacy={!useNext} ref={ref} />;
234
}
235
);
236
+
237
+// React.forwardRef does not type returned component properly, thus breaking Ref<MyComponent> typing.
238
+// One way to overcome this is using separate typing for component "interface",
239
+// but that breaks backward compatibility in this case.
240
+// Approach of merging type is hacky, but produces a good typing for both ref attributes and component itself.
241
+export type PagerView = PagerViewInternal & typeof PagerView;
0 commit comments