showing results for - "how to create a button with react"
Fritz
19 Nov 2017
1import PropTypes from 'prop-types'
2
3const Button = ({ color, text, onClick }) => {
4    return (
5    <button 
6        onClick={onClick}
7        style={{backgroundColor: color}} 
8        className='btn'>
9        {text}
10    </button>
11    )
12}
13
14Button.defaultrops = {
15    color: 'steelblue'
16}
17
18Button.propTypes = {
19    text: PropTypes.string,
20    color:PropTypes.string,
21    onClick: PropTypes.func,
22}
23
24export default Button
queries leading to this page
how do you make a button component in react 3fhow to add a button react apphow to add button in react jshow to make a button in reacthow to add button on reactreact make buttoncreating a button component reactreact create buttonmbutton in button reactmake button html in reactreact button in a buttonreact button example codehow to define a button element in reacthow to add button in reacthow to make button react jshow make a button to a in react 3freact create a buttoncreate button component in reactjsbutton with reactcreate button component in reacthow to create a react buttonhow to add button to reacthow to create button using jsxcreate button react apphow to create a button with reactreact create buttonhow to make a react buttonreact how to create a buttonhow to create a page with button in reacthow to use buttons in react create button in reacthow to create button component in reactcreate button using jsxreactjs how to create buttonreact button examplehow to create a button in reacthwo to make button in reactcreate a button in reacthow to make a react js buttonhow to add a button in reactreact create button componenthow to add buttons to reactreact how to create buttonshow to create button in react jshow to make a button in react jscreate a button component in reacthow to create a button on reactcreate a button in react jscreating button components in reactis there a button component in reactcreate a button using jsxhow to create a component button reactreact button component examplehow to use react buttonreact buttons examplecreate a button reactadd create button in reacthow to create a button in react jshow to add a button in react jshow to create buttons in react jsdeclaring button in react jscreating a button in reacthow to create a button with react