From 82a8ba9f3e1f2c2b6217b9df2a3c5b1ead339529 Mon Sep 17 00:00:00 2001 From: Harsh Rathore Date: Thu, 29 Oct 2020 12:23:14 +0530 Subject: [PATCH] Functional Component Example Added --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 7d7a4e5..0fd4507 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,44 @@ class Example extends Component { return } } +``` +Using Hooks + +```jsx +import React from 'react'; +import { SearchBar } from 'react-search-bar'; + +const Data = [ + { + key: 'john', + value: 'John Doe' + }, + { + key: 'jane', + value: 'Jane Doe' + }, + { + key: 'mary', + value: 'Mary Phillips' + }, + { + key: 'robert', + value: 'Robert' + }, + { + key: 'karius', + value: 'Karius' + } +]; + +const App = () => { + return ( +
+ +
+ ) +} + ``` ## License