mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 19:51:53 +00:00
Add tests and fix broken test
This commit is contained in:
Vendored
+2
-2
@@ -168,7 +168,7 @@ declare namespace React {
|
||||
setState<K extends keyof S>(f: (prevState: S, props: P) => Pick<S, K>, callback?: () => any): void;
|
||||
setState<K extends keyof S>(state: Pick<S, K>, callback?: () => any): void;
|
||||
forceUpdate(callBack?: () => any): void;
|
||||
render(): JSX.Element | null;
|
||||
render(): JSX.Element;
|
||||
|
||||
// React.Props<T> is now deprecated, which means that the `children`
|
||||
// property is not available on `P` by default, even though you can
|
||||
@@ -2624,7 +2624,7 @@ declare global {
|
||||
type Element = JSXElement | null;
|
||||
|
||||
interface ElementClass extends React.Component<any, any> {
|
||||
render(): JSX.Element | null;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
interface ElementAttributesProperty { props: {}; }
|
||||
|
||||
|
||||
@@ -32,3 +32,6 @@ StatelessComponent2.defaultProps = {
|
||||
</text>
|
||||
</g>
|
||||
</svg>;
|
||||
|
||||
const CustomComponent = (props: { flag: boolean }) => props.flag ? React.createElement('div') : null;
|
||||
const UseComponent2 = (f: boolean) => <CustomComponent flag={f} />;
|
||||
|
||||
Reference in New Issue
Block a user