mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 22:40:50 +08:00
Merge pull request #14476 from DefinitelyTyped/master-revertFix
[Master] Revert incorrect fix to React
This commit is contained in:
2
react-day-picker/index.d.ts
vendored
2
react-day-picker/index.d.ts
vendored
@@ -75,7 +75,7 @@ declare namespace ReactDayPicker {
|
||||
toMonth?: Date;
|
||||
localeUtils?: LocaleUtils;
|
||||
locale?: string;
|
||||
captionElement?: React.ReactElement<CaptionElementProps> | null;
|
||||
captionElement?: React.ReactElement<CaptionElementProps>;
|
||||
onDayClick?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
onDayTouchTap?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
onDayMouseEnter?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
|
||||
4
react-dom/index.d.ts
vendored
4
react-dom/index.d.ts
vendored
@@ -28,7 +28,7 @@ declare namespace ReactDOM {
|
||||
container: Element | null,
|
||||
callback?: (component: T) => any): T;
|
||||
function render<P>(
|
||||
element: ReactElement<P> | null,
|
||||
element: ReactElement<P>,
|
||||
container: Element | null,
|
||||
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
||||
|
||||
@@ -57,7 +57,7 @@ declare namespace ReactDOM {
|
||||
callback?: () => any): void;
|
||||
function unstable_renderSubtreeIntoContainer<P>(
|
||||
parentComponent: Component<any, any>,
|
||||
element: ReactElement<P> | null,
|
||||
element: ReactElement<P>,
|
||||
container: Element,
|
||||
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class SwiperTest extends React.Component<IProperties, IState> {
|
||||
super(props);
|
||||
}
|
||||
|
||||
public render(): React.ReactElement<any> | null {
|
||||
public render(): React.ReactElement<any> {
|
||||
return (
|
||||
<Swiper
|
||||
style={styles.wrapper}>
|
||||
|
||||
10
react/index.d.ts
vendored
10
react/index.d.ts
vendored
@@ -171,7 +171,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;
|
||||
render(): JSX.Element | null;
|
||||
|
||||
// React.Props<T> is now deprecated, which means that the `children`
|
||||
// property is not available on `P` by default, even though you can
|
||||
@@ -204,7 +204,7 @@ declare namespace React {
|
||||
|
||||
type SFC<P> = StatelessComponent<P>;
|
||||
interface StatelessComponent<P> {
|
||||
(props: P & { children?: ReactNode }, context?: any): ReactElement<any> | null;
|
||||
(props: P & { children?: ReactNode }, context?: any): ReactElement<any>;
|
||||
propTypes?: ValidationMap<P>;
|
||||
contextTypes?: ValidationMap<any>;
|
||||
defaultProps?: P;
|
||||
@@ -2628,11 +2628,9 @@ declare namespace React {
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface JSXElement extends React.ReactElement<any> { }
|
||||
type Element = JSXElement | null;
|
||||
|
||||
interface Element extends React.ReactElement<any> { }
|
||||
interface ElementClass extends React.Component<any, any> {
|
||||
render(): JSX.Element;
|
||||
render(): JSX.Element | null;
|
||||
}
|
||||
interface ElementAttributesProperty { props: {}; }
|
||||
|
||||
|
||||
@@ -32,6 +32,3 @@ 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