react-only
Version:
🔍 <Only /> displays some contents for a specific screen size
12 lines (11 loc) • 657 B
TypeScript
import * as React from "react";
export declare type OnlyProps<OtherProps = {}> = OtherProps & {
strict?: boolean;
matchMedia?: string;
on?: string;
as?: string | React.ComponentType<OtherProps>;
};
export declare function Only<OtherProps = {}>({ matchMedia, on, strict, as, children, ...props }: React.PropsWithChildren<OnlyProps<OtherProps>>): React.ReactElement<OtherProps, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null;
export declare namespace Only {
var displayName: string;
}