mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Previously, when props/state contained a regexp, it was shown as an empty object. This commit adds regexps as values in need of special rehydration (like Symbols or TypedArrays), and display them as a user might expect. Co-authored-by: Zirak <zirakertan@gmail.com>
35 lines
626 B
JavaScript
35 lines
626 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import React from 'react';
|
|
|
|
function noop() {}
|
|
|
|
export default function SimpleValues() {
|
|
return (
|
|
<ChildComponent
|
|
string="abc"
|
|
emptyString=""
|
|
number={123}
|
|
undefined={undefined}
|
|
null={null}
|
|
nan={NaN}
|
|
infinity={Infinity}
|
|
true={true}
|
|
false={false}
|
|
function={noop}
|
|
regex={/abc[123]+/i}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function ChildComponent(props: any) {
|
|
return null;
|
|
}
|