|
| 1 | + import React from 'react' |
| 2 | +// definition react-example 1.0.0 src/`LoaderInput.tsx`/ |
| 3 | +//documentation ```ts\nmodule "LoaderInput.tsx"\n``` |
| 4 | +// ^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/ |
| 5 | +// ^^^^^^^ reference @types/react 17.0.52 `index.d.ts`/ |
| 6 | + |
| 7 | + /** Takes loading prop, input component as child */ |
| 8 | + interface Props { |
| 9 | +// ^^^^^ definition react-example 1.0.0 src/`LoaderInput.tsx`/Props# |
| 10 | +// documentation ```ts\ninterface Props\n``` |
| 11 | +// documentation Takes loading prop, input component as child |
| 12 | + loading: boolean |
| 13 | +// ^^^^^^^ definition react-example 1.0.0 src/`LoaderInput.tsx`/Props#loading. |
| 14 | +// documentation ```ts\n(property) loading: boolean\n``` |
| 15 | + children: React.ReactNode |
| 16 | +// ^^^^^^^^ definition react-example 1.0.0 src/`LoaderInput.tsx`/Props#children. |
| 17 | +// documentation ```ts\n(property) children: ReactNode\n``` |
| 18 | +// ^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/ |
| 19 | +// ^^^^^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/ReactNode# |
| 20 | + } |
| 21 | + |
| 22 | + export const LoaderInput: React.FunctionComponent<Props> = ({ |
| 23 | +// ^^^^^^^^^^^ definition react-example 1.0.0 src/`LoaderInput.tsx`/LoaderInput. |
| 24 | +// documentation ```ts\nvar LoaderInput: FunctionComponent<Props>\n``` |
| 25 | +// ^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/ |
| 26 | +// ^^^^^^^^^^^^^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/FunctionComponent# |
| 27 | +// ^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props# |
| 28 | + loading, |
| 29 | +// ^^^^^^^ definition local 3 |
| 30 | +// documentation ```ts\n(parameter) loading: boolean\n``` |
| 31 | +// ^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#loading. |
| 32 | + children, |
| 33 | +// ^^^^^^^^ definition local 4 |
| 34 | +// documentation ```ts\n(parameter) children: ReactNode\n``` |
| 35 | +// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children. |
| 36 | +// ^^^^^^^^ reference local 7 |
| 37 | + }) => ( |
| 38 | + <div className="hello"> |
| 39 | +// ^^^ reference @types/react 17.0.52 `index.d.ts`/global/JSX/IntrinsicElements#div. |
| 40 | +// ^^^^^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/HTMLAttributes#className. |
| 41 | + {children} |
| 42 | +// ^^^^^^^^ reference local 4 |
| 43 | + {loading && <p>spinner</p>} |
| 44 | +// ^^^^^^^ reference local 3 |
| 45 | +// ^ reference @types/react 17.0.52 `index.d.ts`/global/JSX/IntrinsicElements#p. |
| 46 | +// ^ reference @types/react 17.0.52 `index.d.ts`/global/JSX/IntrinsicElements#p. |
| 47 | + </div> |
| 48 | +// ^^^ reference @types/react 17.0.52 `index.d.ts`/global/JSX/IntrinsicElements#div. |
| 49 | + ) |
| 50 | + |
| 51 | + export const LoaderInput2: React.FunctionComponent<Props> = props => { |
| 52 | +// ^^^^^^^^^^^^ definition react-example 1.0.0 src/`LoaderInput.tsx`/LoaderInput2. |
| 53 | +// documentation ```ts\nvar LoaderInput2: FunctionComponent<Props>\n``` |
| 54 | +// ^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/ |
| 55 | +// ^^^^^^^^^^^^^^^^^ reference @types/react 17.0.52 `index.d.ts`/React/FunctionComponent# |
| 56 | +// ^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props# |
| 57 | +// ^^^^^ definition local 9 |
| 58 | +// documentation ```ts\n(parameter) props: PropsWithChildren<Props>\n``` |
| 59 | + return <LoaderInput loading={true} key="key" children={props.children} /> |
| 60 | +// ^^^^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/LoaderInput. |
| 61 | +// ^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#loading. |
| 62 | +// ^^^ reference local 13 |
| 63 | +// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children. |
| 64 | +// ^^^^^ reference local 9 |
| 65 | +// ^^^^^^^^ reference react-example 1.0.0 src/`LoaderInput.tsx`/Props#children. |
| 66 | +// ^^^^^^^^ reference local 7 |
| 67 | + } |
| 68 | + |
0 commit comments