Created
April 5, 2020 03:34
-
-
Save arshmakker/3c00ae25e814174f2e7276f7fbd79bfc to your computer and use it in GitHub Desktop.
a React Molecule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Button from './Button'; | |
const defaultProps = { | |
classSearch: "", | |
title="Search", | |
searchPlaceholder:"Type here to search" | |
} | |
function Search(props =defaultProps) { | |
const {classSearch, title, searchPlaceholder, onSearch}= props | |
return ( | |
<div className={classSearch}> | |
<Button title={title} onClick={onSearch}></Button> | |
<input type="text" id="searchText" placeholder={searchPlaceholder}/> | |
</div> | |
) | |
} | |
export default Search; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment