mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
withStorage: fix typings
This commit is contained in:
parent
22645b9814
commit
163d94e5a8
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import useStorage from '~/logic/lib/useStorage';
|
||||
import useStorage, {IuseStorage} from '~/logic/lib/useStorage';
|
||||
|
||||
const withStorage = (Component, params = {}) => {
|
||||
return React.forwardRef((props: any, ref) => {
|
||||
const withStorage = <P, C extends React.ComponentType<P>>(Component: C, params = {}) => {
|
||||
return React.forwardRef<C, Omit<C, keyof IuseStorage>>((props, ref) => {
|
||||
const storage = useStorage(params);
|
||||
|
||||
return <Component ref={ref} {...storage} {...props} />;
|
||||
|
Loading…
Reference in New Issue
Block a user