mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Propagate non-optional props change to dependent libraries
This commit is contained in:
@@ -30,7 +30,7 @@ type SyntheticKeyboardEvent = React.KeyboardEvent<{}>;
|
||||
|
||||
class RichEditorExample extends React.Component<{}, { editorState: EditorState }> {
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
|
||||
const sampleMarkup =
|
||||
'<b>Bold text</b>, <i>Italic text</i><br/ ><br />' +
|
||||
@@ -182,9 +182,17 @@ function getBlockStyle(block: ContentBlock) {
|
||||
}
|
||||
}
|
||||
|
||||
class StyleButton extends React.Component<{key: string, active: boolean, label: string, onToggle: (blockType: string) => void, style: string}> {
|
||||
constructor() {
|
||||
super();
|
||||
interface Props {
|
||||
key: string
|
||||
active: boolean
|
||||
label: string
|
||||
onToggle: (blockType: string) => void
|
||||
style: string
|
||||
}
|
||||
|
||||
class StyleButton extends React.Component<Props> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
onToggle: (event: Event) => void = (event: Event) => {
|
||||
|
||||
@@ -254,7 +254,7 @@ describe('toHaveRef', () => {
|
||||
describe('toHaveState', () => {
|
||||
class Fixture extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
this.state = {
|
||||
foo: false,
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ interface PagerState {
|
||||
|
||||
class Pager extends React.Component<{}, PagerState> {
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
this.state = {
|
||||
pageIndex: 0
|
||||
};
|
||||
|
||||
@@ -7002,7 +7002,7 @@ class BottomNavigationExample extends Component<{}, {
|
||||
index?: number
|
||||
}> {
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
this.state = {
|
||||
index: 0
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import DatePicker from 'react-datepicker';
|
||||
|
||||
class ReactDatePicker extends React.Component<{}, { startDate: moment.Moment; displayName: string; }> {
|
||||
constructor(props: {}) {
|
||||
super();
|
||||
super(props);
|
||||
this.state = {
|
||||
startDate: moment(),
|
||||
displayName: 'Example'
|
||||
|
||||
2
types/react-dom/test-utils/index.d.ts
vendored
2
types/react-dom/test-utils/index.d.ts
vendored
@@ -59,7 +59,7 @@ export interface SyntheticEventData extends OptionalEventProperties {
|
||||
export type EventSimulator = (element: Element | Component<any>, eventData?: SyntheticEventData) => void;
|
||||
|
||||
export interface MockedComponentClass {
|
||||
new (): any;
|
||||
new (props: {}): any;
|
||||
}
|
||||
|
||||
export interface ShallowRenderer {
|
||||
|
||||
@@ -7,7 +7,7 @@ interface State {
|
||||
|
||||
class Normal extends React.Component<{}, State> {
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
const arr: string[] = [];
|
||||
for (let i = 0; i < 200; i++) {
|
||||
arr.push(`${i}`);
|
||||
|
||||
@@ -141,7 +141,7 @@ class MKRadioButtonTest extends React.Component<null, null> {
|
||||
radioGroup: MKRadioButton.Group;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
super(null);
|
||||
this.radioGroup = new MKRadioButton.Group();
|
||||
|
||||
setTheme({radioStyle: {
|
||||
@@ -165,7 +165,7 @@ class MKRadioButtonTest extends React.Component<null, null> {
|
||||
/// Checkbox
|
||||
class MKCheckboxTest extends React.Component<null, null> {
|
||||
constructor() {
|
||||
super();
|
||||
super(null);
|
||||
|
||||
setTheme({checkboxStyle: {
|
||||
fillColor: MKColor.Teal,
|
||||
|
||||
@@ -68,7 +68,7 @@ const DialogExample = () =>
|
||||
|
||||
class BottomNavigationExample extends React.Component<null, {active: string}> {
|
||||
constructor() {
|
||||
super();
|
||||
super(null);
|
||||
|
||||
this.state = {
|
||||
active: 'today'
|
||||
|
||||
@@ -24,7 +24,7 @@ class Example extends React.Component<{}, State> {
|
||||
modal6: Modal;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
|
||||
this.state = {
|
||||
isOpen: false,
|
||||
|
||||
@@ -10,7 +10,7 @@ const tabBarImage = 'https://assets-cdn.github.com/images/modules/logos_page/Git
|
||||
|
||||
class TabTest extends React.Component<any, TabTestState> {
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
|
||||
this.state = {
|
||||
selectedTab: 'home'
|
||||
|
||||
@@ -43,9 +43,9 @@ class Example extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
class TabTest extends React.Component<any, { selectedTab: string }> {
|
||||
class TabTest extends React.Component<{}, { selectedTab: string }> {
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
|
||||
this.state = {
|
||||
selectedTab: 'tab1'
|
||||
@@ -85,7 +85,7 @@ class TabTest extends React.Component<any, { selectedTab: string }> {
|
||||
|
||||
class TestCustomIcon extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
super({});
|
||||
}
|
||||
|
||||
handleButton() {
|
||||
|
||||
2
types/react-onclickoutside/index.d.ts
vendored
2
types/react-onclickoutside/index.d.ts
vendored
@@ -26,7 +26,7 @@ export interface OnClickOutProps {
|
||||
export type ComponentConstructor<P> = React.ComponentClass<P> | React.StatelessComponent<P>;
|
||||
|
||||
export interface ClickOutComponentClass<P extends InjectedOnClickOutProps> extends React.ComponentClass<P> {
|
||||
new (props?: P, context?: any): React.Component<P, React.ComponentState> & HandleClickOutside<any>;
|
||||
new (props: P, context?: any): React.Component<P, React.ComponentState> & HandleClickOutside<any>;
|
||||
}
|
||||
|
||||
export default function OnClickOut<P>(
|
||||
|
||||
@@ -9,7 +9,7 @@ class AppState {
|
||||
interface AppProps {} // tslint:disable-line no-empty-interface
|
||||
|
||||
export class App extends React.Component<AppProps, AppState> {
|
||||
constructor(props?: AppProps) {
|
||||
constructor(props: AppProps) {
|
||||
super(props);
|
||||
this.state = new AppState();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ function test() {
|
||||
toastr.confirm("Test", { onOk: callback, onCancel: callback });
|
||||
toastr.error("Error", "Error message");
|
||||
toastr.info("Info", "Info test", { timeOut: 1000, removeOnHover: true, onShowComplete: callback });
|
||||
toastr.success("Test", "Test message", { component: new React.Component() });
|
||||
toastr.success("Test", "Test message", { component: new React.Component({}) });
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
@@ -50,7 +50,7 @@ class SortableComponent extends React.Component<{}, SortableComponentState> {
|
||||
}
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
super({});
|
||||
this.state = {
|
||||
items: ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6'],
|
||||
axis: 'x'
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
var version = ReactSWF.getFPVersion();
|
||||
var isFPVersionSupported = ReactSWF.isFPVersionSupported('5');
|
||||
var reactSWF = new ReactSWF();
|
||||
reactSWF.props = {
|
||||
src:'',pluginspage:'',width:20,height:20
|
||||
}
|
||||
var reactSWF = new ReactSWF({
|
||||
src:'',
|
||||
pluginspage:'',
|
||||
width:20,
|
||||
height:20,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user