mirror of
https://github.com/reiyua/RaysBookClub.git
synced 2026-01-20 15:37:47 +00:00
Half-assed, failed attempt at a native search box using "react-search-box"
This commit is contained in:
parent
de57405515
commit
0b131a3b64
1 changed files with 38 additions and 0 deletions
38
src/components/search-box.js
Normal file
38
src/components/search-box.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import React, { Component } from "react";
|
||||
import ReactSearchBox from "react-search-box";
|
||||
|
||||
export default class App extends Component {
|
||||
data = [
|
||||
{
|
||||
key: "john",
|
||||
value: "John Doe",
|
||||
},
|
||||
{
|
||||
key: "jane",
|
||||
value: "Jane Doe",
|
||||
},
|
||||
{
|
||||
key: "mary",
|
||||
value: "Mary Phillips",
|
||||
},
|
||||
{
|
||||
key: "robert",
|
||||
value: "Robert",
|
||||
},
|
||||
{
|
||||
key: "karius",
|
||||
value: "Karius",
|
||||
},
|
||||
];
|
||||
|
||||
render() {
|
||||
return (
|
||||
<ReactSearchBox
|
||||
placeholder="Search book collection"
|
||||
value="Book"
|
||||
data={book.data}
|
||||
callback={(record) => console.log(record)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue