|
1 | 1 | //// [tests/cases/conformance/jsdoc/declarations/jsDeclarationsReactComponents.ts] ////
|
2 | 2 |
|
3 | 3 | //// [jsDeclarationsReactComponents1.jsx]
|
4 |
| -/// <reference path="/.lib/react16.d.ts" preserve="true" /> |
5 |
| -import React from "react"; |
6 |
| -import PropTypes from "prop-types" |
7 |
| - |
8 |
| -const TabbedShowLayout = ({ |
9 |
| -}) => { |
10 |
| - return ( |
11 |
| - <div /> |
12 |
| - ); |
13 |
| -}; |
14 |
| - |
15 |
| -TabbedShowLayout.propTypes = { |
16 |
| - version: PropTypes.number, |
17 |
| - |
18 |
| -}; |
19 |
| - |
20 |
| -TabbedShowLayout.defaultProps = { |
21 |
| - tabs: undefined |
22 |
| -}; |
23 |
| - |
24 |
| -export default TabbedShowLayout; |
| 4 | +/// <reference path="/.lib/react16.d.ts" preserve="true" /> |
| 5 | +import React from "react"; |
| 6 | +import PropTypes from "prop-types" |
| 7 | + |
| 8 | +const TabbedShowLayout = ({ |
| 9 | +}) => { |
| 10 | + return ( |
| 11 | + <div /> |
| 12 | + ); |
| 13 | +}; |
| 14 | + |
| 15 | +TabbedShowLayout.propTypes = { |
| 16 | + version: PropTypes.number, |
| 17 | + |
| 18 | +}; |
| 19 | + |
| 20 | +TabbedShowLayout.defaultProps = { |
| 21 | + tabs: undefined |
| 22 | +}; |
| 23 | + |
| 24 | +export default TabbedShowLayout; |
25 | 25 |
|
26 | 26 | //// [jsDeclarationsReactComponents2.jsx]
|
27 |
| -import React from "react"; |
28 |
| -/** |
29 |
| - * @type {React.SFC} |
30 |
| - */ |
31 |
| -const TabbedShowLayout = () => { |
32 |
| - return ( |
33 |
| - <div className="" key=""> |
34 |
| - ok |
35 |
| - </div> |
36 |
| - ); |
37 |
| -}; |
38 |
| - |
39 |
| -TabbedShowLayout.defaultProps = { |
40 |
| - tabs: "default value" |
41 |
| -}; |
42 |
| - |
43 |
| -export default TabbedShowLayout; |
| 27 | +import React from "react"; |
| 28 | +/** |
| 29 | + * @type {React.SFC} |
| 30 | + */ |
| 31 | +const TabbedShowLayout = () => { |
| 32 | + return ( |
| 33 | + <div className="" key=""> |
| 34 | + ok |
| 35 | + </div> |
| 36 | + ); |
| 37 | +}; |
| 38 | + |
| 39 | +TabbedShowLayout.defaultProps = { |
| 40 | + tabs: "default value" |
| 41 | +}; |
| 42 | + |
| 43 | +export default TabbedShowLayout; |
44 | 44 |
|
45 | 45 | //// [jsDeclarationsReactComponents3.jsx]
|
46 |
| -import React from "react"; |
47 |
| -/** |
48 |
| - * @type {{defaultProps: {tabs: string}} & ((props?: {elem: string}) => JSX.Element)} |
49 |
| - */ |
50 |
| -const TabbedShowLayout = () => { |
51 |
| - return ( |
52 |
| - <div className="" key=""> |
53 |
| - ok |
54 |
| - </div> |
55 |
| - ); |
56 |
| -}; |
57 |
| - |
58 |
| -TabbedShowLayout.defaultProps = { |
59 |
| - tabs: "default value" |
60 |
| -}; |
61 |
| - |
62 |
| -export default TabbedShowLayout; |
| 46 | +import React from "react"; |
| 47 | +/** |
| 48 | + * @type {{defaultProps: {tabs: string}} & ((props?: {elem: string}) => JSX.Element)} |
| 49 | + */ |
| 50 | +const TabbedShowLayout = () => { |
| 51 | + return ( |
| 52 | + <div className="" key=""> |
| 53 | + ok |
| 54 | + </div> |
| 55 | + ); |
| 56 | +}; |
| 57 | + |
| 58 | +TabbedShowLayout.defaultProps = { |
| 59 | + tabs: "default value" |
| 60 | +}; |
| 61 | + |
| 62 | +export default TabbedShowLayout; |
63 | 63 |
|
64 | 64 | //// [jsDeclarationsReactComponents4.jsx]
|
65 |
| -import React from "react"; |
66 |
| -const TabbedShowLayout = (/** @type {{className: string}}*/prop) => { |
67 |
| - return ( |
68 |
| - <div className={prop.className} key=""> |
69 |
| - ok |
70 |
| - </div> |
71 |
| - ); |
72 |
| -}; |
73 |
| - |
74 |
| -TabbedShowLayout.defaultProps = { |
75 |
| - tabs: "default value" |
76 |
| -}; |
77 |
| - |
| 65 | +import React from "react"; |
| 66 | +const TabbedShowLayout = (/** @type {{className: string}}*/prop) => { |
| 67 | + return ( |
| 68 | + <div className={prop.className} key=""> |
| 69 | + ok |
| 70 | + </div> |
| 71 | + ); |
| 72 | +}; |
| 73 | + |
| 74 | +TabbedShowLayout.defaultProps = { |
| 75 | + tabs: "default value" |
| 76 | +}; |
| 77 | + |
78 | 78 | export default TabbedShowLayout;
|
79 | 79 | //// [jsDeclarationsReactComponents5.jsx]
|
80 |
| -import React from 'react'; |
81 |
| -import PropTypes from 'prop-types'; |
82 |
| - |
83 |
| -function Tree({ allowDropOnRoot }) { |
84 |
| - return <div /> |
85 |
| -} |
86 |
| - |
87 |
| -Tree.propTypes = { |
88 |
| - classes: PropTypes.object, |
89 |
| -}; |
90 |
| - |
91 |
| -Tree.defaultProps = { |
92 |
| - classes: {}, |
93 |
| - parentSource: 'parent_id', |
94 |
| -}; |
95 |
| - |
| 80 | +import React from 'react'; |
| 81 | +import PropTypes from 'prop-types'; |
| 82 | + |
| 83 | +function Tree({ allowDropOnRoot }) { |
| 84 | + return <div /> |
| 85 | +} |
| 86 | + |
| 87 | +Tree.propTypes = { |
| 88 | + classes: PropTypes.object, |
| 89 | +}; |
| 90 | + |
| 91 | +Tree.defaultProps = { |
| 92 | + classes: {}, |
| 93 | + parentSource: 'parent_id', |
| 94 | +}; |
| 95 | + |
96 | 96 | export default Tree;
|
97 | 97 |
|
98 | 98 | //// [jsDeclarationsReactComponents1.js]
|
@@ -249,7 +249,8 @@ out/jsDeclarationsReactComponents1.d.ts(3,15): error TS2503: Cannot find namespa
|
249 | 249 | out/jsDeclarationsReactComponents2.d.ts(1,19): error TS2307: Cannot find module 'react' or its corresponding type declarations.
|
250 | 250 | out/jsDeclarationsReactComponents3.d.ts(10,7): error TS2503: Cannot find namespace 'JSX'.
|
251 | 251 | out/jsDeclarationsReactComponents4.d.ts(4,9): error TS2503: Cannot find namespace 'JSX'.
|
252 |
| -out/jsDeclarationsReactComponents5.d.ts(3,5): error TS2503: Cannot find namespace 'JSX'. |
| 252 | +out/jsDeclarationsReactComponents5.d.ts(1,23): error TS2307: Cannot find module 'prop-types' or its corresponding type declarations. |
| 253 | +out/jsDeclarationsReactComponents5.d.ts(4,5): error TS2503: Cannot find namespace 'JSX'. |
253 | 254 |
|
254 | 255 |
|
255 | 256 | ==== out/jsDeclarationsReactComponents1.d.ts (2 errors) ====
|
|
0 commit comments