File tree Expand file tree Collapse file tree 4 files changed +3
-28
lines changed
Expand file tree Collapse file tree 4 files changed +3
-28
lines changed Original file line number Diff line number Diff line change 44 "private" : true ,
55 "dependencies" : {
66 "axios" : " ^0.18.0" ,
7- "prop-types" : " ^15.7.2" ,
87 "react" : " ^16.8.4" ,
98 "react-dom" : " ^16.8.4" ,
109 "react-scripts" : " 2.1.8"
Original file line number Diff line number Diff line change 11import React , { Component } from 'react' ;
22import axios from 'axios' ;
3- import PropTypes from 'prop-types' ;
43import './App.css' ;
54
65const DEFAULT_QUERY = 'redux' ;
@@ -205,22 +204,10 @@ const Table = ({ list, onDismiss }) =>
205204 ) }
206205 </ div >
207206
208- Table . propTypes = {
209- list : PropTypes . arrayOf (
210- PropTypes . shape ( {
211- objectID : PropTypes . string . isRequired ,
212- author : PropTypes . string ,
213- url : PropTypes . string ,
214- num_comments : PropTypes . number ,
215- points : PropTypes . number ,
216- } )
217- ) . isRequired ,
218- onDismiss : PropTypes . func . isRequired ,
219- } ;
220207
221208const Button = ( {
222209 onClick,
223- className,
210+ className = '' ,
224211 children,
225212} ) =>
226213 < button
@@ -231,16 +218,6 @@ const Button = ({
231218 { children }
232219 </ button >
233220
234- Button . defaultProps = {
235- className : '' ,
236- } ;
237-
238- Button . propTypes = {
239- onClick : PropTypes . func . isRequired ,
240- className : PropTypes . string ,
241- children : PropTypes . node . isRequired ,
242- } ;
243-
244221export default App ;
245222
246223export {
Original file line number Diff line number Diff line change @@ -47,13 +47,13 @@ describe('Button', () => {
4747
4848 it ( 'renders without crashing' , ( ) => {
4949 const div = document . createElement ( 'div' ) ;
50- ReactDOM . render ( < Button onClick = { ( ) => { } } > Give Me More</ Button > , div ) ;
50+ ReactDOM . render ( < Button > Give Me More</ Button > , div ) ;
5151 ReactDOM . unmountComponentAtNode ( div ) ;
5252 } ) ;
5353
5454 test ( 'has a valid snapshot' , ( ) => {
5555 const component = renderer . create (
56- < Button onClick = { ( ) => { } } > Give Me More</ Button >
56+ < Button > Give Me More</ Button >
5757 ) ;
5858 const tree = component . toJSON ( ) ;
5959 expect ( tree ) . toMatchSnapshot ( ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ exports[`App has a valid snapshot 1`] = `
4242exports [` Button has a valid snapshot 1` ] = `
4343<button
4444 className = " "
45- onClick = { [Function ]}
4645 type = " button"
4746>
4847 Give Me More
You can’t perform that action at this time.
0 commit comments