| 1 | // Example |
| 2 | |
| 3 | export const Throw = React.lazy(() => { |
| 4 | throw new Error('Example'); |
| 5 | }); |
| 6 | |
| 7 | export const Component = React.memo(function Component({children}) { |
| 8 | return children; |
| 9 | }); |
| 10 | |
| 11 | export function DisplayName({children}) { |
| 12 | return children; |
| 13 | } |
| 14 | DisplayName.displayName = 'Custom Name'; |
| 15 | |
| 16 | export class NativeClass extends React.Component { |
| 17 | render() { |
| 18 | return this.props.children; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export class FrozenClass extends React.Component { |
| 23 | constructor() { |
| 24 | super(); |
| 25 | } |
| 26 | render() { |
| 27 | return this.props.children; |
| 28 | } |
| 29 | } |
| 30 | Object.freeze(FrozenClass.prototype); |