Skip to content

Instantly share code, notes, and snippets.

@arshmakker
Created April 5, 2020 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arshmakker/3c00ae25e814174f2e7276f7fbd79bfc to your computer and use it in GitHub Desktop.
Save arshmakker/3c00ae25e814174f2e7276f7fbd79bfc to your computer and use it in GitHub Desktop.
a React Molecule
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