mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Added Set+Map to dev shell, even though we don't support deep inspecting them yet
This commit is contained in:
@@ -4,6 +4,7 @@ import React, { Fragment } from 'react';
|
||||
import Contexts from './Contexts';
|
||||
import CustomHooks from './CustomHooks';
|
||||
import CustomObject from './CustomObject';
|
||||
import MapAndSet from './MapAndSet';
|
||||
import NestedProps from './NestedProps';
|
||||
import SimpleValues from './SimpleValues';
|
||||
|
||||
@@ -14,6 +15,7 @@ export default function InspectableElements() {
|
||||
<Fragment>
|
||||
<h1>Inspectable elements</h1>
|
||||
<SimpleValues />
|
||||
<MapAndSet />
|
||||
<NestedProps />
|
||||
<Contexts />
|
||||
<CustomHooks />
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
// @flow
|
||||
|
||||
import React from 'react';
|
||||
|
||||
const set = new Set();
|
||||
set.add('abc');
|
||||
set.add(123);
|
||||
|
||||
const map = new Map();
|
||||
map.set('name', 'Brian');
|
||||
map.set('food', 'sushi');
|
||||
|
||||
export default function MapAndSet() {
|
||||
return <ChildComponent map={map} set={set} />;
|
||||
}
|
||||
|
||||
function ChildComponent(props: any) {
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user