| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * |
| 7 | * @flow |
| 8 | */ |
| 9 | |
| 10 | import * as React from 'react'; |
| 11 | |
| 12 | const object = { |
| 13 | string: 'abc', |
| 14 | longString: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKJLMNOPQRSTUVWXYZ1234567890', |
| 15 | emptyString: '', |
| 16 | number: 123, |
| 17 | boolean: true, |
| 18 | undefined: undefined, |
| 19 | null: null, |
| 20 | }; |
| 21 | |
| 22 | export default function ObjectProps(): React.Node { |
| 23 | return ( |
| 24 | <ChildComponent |
| 25 | object={{ |
| 26 | outer: { |
| 27 | inner: object, |
| 28 | }, |
| 29 | }} |
| 30 | array={['first', 'second', 'third']} |
| 31 | objectInArray={[object]} |
| 32 | arrayInObject={{array: ['first', 'second', 'third']}} |
| 33 | deepObject={{ |
| 34 | // Known limitation: we won't go deeper than several levels. |
| 35 | // In the future, we might offer a way to request deeper access on demand. |
| 36 | a: { |
| 37 | b: { |
| 38 | c: { |
| 39 | d: { |
| 40 | e: { |
| 41 | f: { |
| 42 | g: { |
| 43 | h: { |
| 44 | i: { |
| 45 | j: 10, |
| 46 | }, |
| 47 | }, |
| 48 | }, |
| 49 | }, |
| 50 | }, |
| 51 | }, |
| 52 | }, |
| 53 | }, |
| 54 | }, |
| 55 | }} |
| 56 | emptyArray={[]} |
| 57 | emptyObject={{}} |
| 58 | /> |
| 59 | ); |
| 60 | } |
| 61 | |
| 62 | function ChildComponent(props: any) { |
| 63 | return null; |
| 64 | } |