I need to display the react component in the readme.md file but it requires props which has array of strings. What is the correct way of passing props for components defined in the .md file?
I have tried to refer to the example which is in the documentation but I am getting errors in the output.
Below is the data i am passing in my component.
const data = {dropdownvalues: [{label: '10',value: '10'}]};
I need to pass them to my component in documentation.
<Dropdown data={data}></Dropdown>
how to define data in the .md file.
Dropdown.js
import React from 'react';
export default function Dropdown (props) {
const { dropdownValues } = props.data
return (
<select>
{ dropdownValues.length && dropdownValues.map(data => {
return (<option value={data.label}>{data.value}</option>)
})
}
</select>
)
}
Dropdown.md
```
<Dropdown data={{ "dropdownValues": [{ "label": "10", "value": "10", key: "1" }] }}></Dropdown>
```
Hope that helps!!!