Revert "Add tests and fix broken test"

This reverts commit d79f340d57.
This commit is contained in:
Kanchalai Tanglertsampan
2017-02-06 17:05:24 -08:00
parent a3dd726ba3
commit 47f5a06ab0
7 changed files with 16 additions and 19 deletions

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -13,7 +13,7 @@ declare namespace reactInputMask {
* * `9`: `0-9`
* * `a`: `A-Z, a-z`
* * `\*`: `A-Z, a-z, 0-9`
*
*
* Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}`
*/
mask: string;

View File

@@ -37,9 +37,9 @@ export interface renderTabBarProperties {
interface ScrollableTabViewProperties extends React.Props<ScrollableTabView> {
/**
* tabBarPosition (String) Defaults to "top".
* tabBarPosition (String) Defaults to "top".
* "bottom" to position the tab bar below content.
* "overlayTop" or "overlayBottom" for a semitransparent tab bar that overlays content. Custom
* "overlayTop" or "overlayBottom" for a semitransparent tab bar that overlays content. Custom
* tab bars must consume a style prop on their outer element to support this feature: style={this.props.style}.
*/
tabBarPosition?: 'top' | 'bottom' | 'overlayTop' | 'overlayBottom';
@@ -50,27 +50,27 @@ interface ScrollableTabViewProperties extends React.Props<ScrollableTabView> {
initialPage?: number;
/**
* (Integer) - set selected tab(can be buggy see
* (Integer) - set selected tab(can be buggy see
* https://github.com/skv-headless/react-native-scrollable-tab-view/issues/126
*/
page?: number;
/**
* onChangeTab (Function) - function to call when tab changes, should accept 1 argument which is
* an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the
* onChangeTab (Function) - function to call when tab changes, should accept 1 argument which is
* an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the
* tab that is selected
*/
onChangeTab?: (value: onChangeTabProperties) => void;
/**
* onScroll (Function) - function to call when the pages are sliding,
* onScroll (Function) - function to call when the pages are sliding,
* should accept 1 argument which is an Float number representing the page position in the slide frame.
*/
onScroll?: (value: number) => void;
/**
* renderTabBar (Function:ReactComponent) - accept 1 argument props and should return a component
* to use as the tab bar. The component has goToPage, tabs, activeTab and ref added to the props,
* to use as the tab bar. The component has goToPage, tabs, activeTab and ref added to the props,
* and should implement setAnimationValue to be able to animate itself along with the tab content.
* You can manually pass the props to the TabBar component.
*/
@@ -82,7 +82,7 @@ interface ScrollableTabViewProperties extends React.Props<ScrollableTabView> {
style?: ViewStyle;
/**
* contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid.
* contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid.
* Note that overriding defaults set by the library may break functionality; see the source for details.
*/
contentProps?: React.ScrollViewProperties;
@@ -98,7 +98,7 @@ interface ScrollableTabViewProperties extends React.Props<ScrollableTabView> {
locked?: boolean;
/**
* prerenderingSiblingsNumber (Integer) - pre-render nearby # sibling, Infinity === render all
* prerenderingSiblingsNumber (Integer) - pre-render nearby # sibling, Infinity === render all
* the siblings, default to 0 === render current page.
*/
prerenderingSiblingsNumber?: number;

View File

@@ -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}>

4
react/index.d.ts vendored
View File

@@ -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
@@ -2630,7 +2630,7 @@ declare global {
namespace JSX {
interface Element extends React.ReactElement<any> { }
interface ElementClass extends React.Component<any, any> {
render(): JSX.Element;
render(): JSX.Element | null;
}
interface ElementAttributesProperty { props: {}; }

View File

@@ -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} />;