-
Notifications
You must be signed in to change notification settings - Fork 82
/
AccessDataByPath.js
36 lines (33 loc) · 1.03 KB
/
AccessDataByPath.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react';
import Select from '../../../src';
import { options } from '../options';
import { Heading } from './components/Heading';
const AccessDataByPath = ({ title }) => (
<React.Fragment>
<Heading
title={title}
source="https://github.com/sanusart/react-dropdown-select/tree/master/docs/src/examples/AccessDataByPath.js"
/>
<p>
"Label" is accessed via <code>company.catchPhrase</code> nested property of the{' '}
<a href="https://github.com/sanusart/react-dropdown-select/tree/master/docs/src/options.js#L21">
options
</a>{' '}
object
</p>
<Select
multi
options={options}
values={[]}
valueField="address.city"
labelField="company.catchPhrase"
searchBy="company.catchPhrase"
sortBy="company.catchPhrase"
onChange={(value) =>
console.log(`%c > onChange ${title} `, 'background: #555; color: tomato', value)
}
/>
</React.Fragment>
);
AccessDataByPath.propTypes = {};
export default AccessDataByPath;