mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
[react-addons-shallow-compare] Added tests
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
/// <reference path="tests/import-commonjs.tsx" />
|
||||
/// <reference path="tests/import-es6.tsx" />
|
||||
@@ -0,0 +1,12 @@
|
||||
import React = require('react');
|
||||
import shallowCompare = require('react-addons-shallow-compare');
|
||||
|
||||
export class MyComponent extends React.Component<{}, {}> {
|
||||
shouldComponentUpdate(nextProps: any, nextState: any, nextContext: any): boolean {
|
||||
return shallowCompare(this, nextProps, nextState);
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div>empty</div>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import * as React from 'react';
|
||||
import * as shallowCompare from 'react-addons-shallow-compare';
|
||||
|
||||
export class MyComponent extends React.Component<{}, {}> {
|
||||
shouldComponentUpdate(nextProps: any, nextState: any, nextContext: any): boolean {
|
||||
return shallowCompare(this, nextProps, nextState);
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div>empty</div>;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
"index.d.ts",
|
||||
"react-addons-shallow-compare-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
@@ -13,6 +14,7 @@
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "preserve"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user