SpotifyControls plugin (#190)

This commit is contained in:
Ven 2022-11-07 22:28:29 +01:00 committed by GitHub
parent 7d5ade21fc
commit 6a8564089b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 852 additions and 64 deletions

View file

@ -74,9 +74,9 @@ export function useAwaiter<T>(factory: () => Promise<T>, fallbackValue: T | null
* @param factory Function returning a Component
* @returns Result of factory function
*/
export function LazyComponent<T extends JSX.IntrinsicAttributes = any>(factory: () => React.ComponentType<T>) {
export function LazyComponent<T = any>(factory: () => React.ComponentType<T>) {
const get = makeLazy(factory);
return (props: T) => {
return (props: T & JSX.IntrinsicAttributes) => {
const Component = get();
return <Component {...props} />;
};