dbjohnson / reactable-search

React search table
MIT License
12 stars 3 forks source link

Change th name! #4

Closed VincenzoCarlino closed 6 years ago

VincenzoCarlino commented 6 years ago

Hi, how can I change the name dislayed in element? Because I cannot make a json whit blank spaces. There is a solution?

dbjohnson commented 6 years ago

Hi @Vincenzo1997, please see example below - you can use arbitrary string values for the JSON object keys, which flow through to the . Please let me know if it helps.

import SearchTable from 'reactable-search';
import ReactDOM from 'react-dom';

const rows = [
  {'foo bar': 1, 'baz qux': 2},
  {'foo bar': 2, 'baz qux': 3},
];

ReactDOM.render(
  <SearchTable
    searchPrompt="Type to search"
    rows={rows}/>,
  document.getElementByID("root")
);