mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Renaming based on the new React API
http://facebook.github.io/react/blog/2014/10/16/react-v0.12-rc1.html#renamed-apis
This commit is contained in:
parent
8336da666d
commit
d908e8f3bf
@ -14,7 +14,7 @@ var PropTypesSpecification: React.Specification<any, any> = {
|
||||
|
||||
// Anything that can be rendered: numbers, strings, components or an array
|
||||
// containing these types.
|
||||
optionalRenderable: React.PropTypes.renderable,
|
||||
optionalRenderable: React.PropTypes.node,
|
||||
|
||||
// A React component.
|
||||
optionalComponent: React.PropTypes.component,
|
||||
@ -78,7 +78,7 @@ var HelloMessage = React.createClass({displayName: 'HelloMessage',
|
||||
}
|
||||
});
|
||||
|
||||
React.renderComponent(HelloMessage({name: "John"}), mountNode);
|
||||
React.render(HelloMessage({name: "John"}), mountNode);
|
||||
|
||||
var Timer = React.createClass({displayName: 'Timer',
|
||||
getInitialState: function() {
|
||||
@ -104,7 +104,7 @@ var Timer = React.createClass({displayName: 'Timer',
|
||||
}
|
||||
});
|
||||
|
||||
React.renderComponent(Timer(null), mountNode);
|
||||
React.render(Timer(null), mountNode);
|
||||
|
||||
// TestUtils
|
||||
var that: React.Component<any, any>;
|
||||
|
||||
@ -14,7 +14,7 @@ var PropTypesSpecification: React.Specification<any, any> = {
|
||||
|
||||
// Anything that can be rendered: numbers, strings, components or an array
|
||||
// containing these types.
|
||||
optionalRenderable: React.PropTypes.renderable,
|
||||
optionalRenderable: React.PropTypes.node,
|
||||
|
||||
// A React component.
|
||||
optionalComponent: React.PropTypes.component,
|
||||
@ -78,7 +78,7 @@ var HelloMessage = React.createClass({displayName: 'HelloMessage',
|
||||
}
|
||||
});
|
||||
|
||||
React.renderComponent(HelloMessage({name: "John"}), mountNode);
|
||||
React.render(HelloMessage({name: "John"}), mountNode);
|
||||
|
||||
var Timer = React.createClass({displayName: 'Timer',
|
||||
getInitialState: function() {
|
||||
@ -104,4 +104,4 @@ var Timer = React.createClass({displayName: 'Timer',
|
||||
}
|
||||
});
|
||||
|
||||
React.renderComponent(Timer(null), mountNode);
|
||||
React.render(Timer(null), mountNode);
|
||||
10
react/react.d.ts
vendored
10
react/react.d.ts
vendored
@ -10,17 +10,17 @@ declare module "react" {
|
||||
declare module React {
|
||||
export function createClass<P, S>(specification: Specification<P, S>): Factory<P>;
|
||||
|
||||
export function renderComponent<P>(component: Descriptor<P>, container: Element, callback?: () => void): Descriptor<P>;
|
||||
export function render<P>(component: Descriptor<P>, container: Element, callback?: () => void): Descriptor<P>;
|
||||
|
||||
export function unmountComponentAtNode(container: Element): boolean;
|
||||
|
||||
export function renderComponentToString(component: Descriptor<any>): string;
|
||||
export function renderToString(component: Descriptor<any>): string;
|
||||
|
||||
export function renderComponentToStaticMarkup(component: Descriptor<any>): string;
|
||||
export function renderToStaticMarkup(component: Descriptor<any>): string;
|
||||
|
||||
export function isValidClass(factory: Factory<any>): boolean;
|
||||
|
||||
export function isValidComponent(component: Descriptor<any>): boolean;
|
||||
export function isValidElement(component: Descriptor<any>): boolean;
|
||||
|
||||
export function initializeTouchEvents(shouldUseTouch: boolean): void;
|
||||
|
||||
@ -97,7 +97,7 @@ declare module React {
|
||||
number: Requireable<any>;
|
||||
object: Requireable<any>;
|
||||
string: Requireable<any>;
|
||||
renderable: Requireable<any>;
|
||||
node: Requireable<any>;
|
||||
component: Requireable<any>;
|
||||
instanceOf: (clazz: Constructable) => Requireable<any>;
|
||||
oneOf: (types: any[]) => Requireable<any>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user