codesydney / codesydneywebsite

codesydneywebsite.vercel.app
10 stars 13 forks source link

Converts Contact.jsx to Function Component #94

Closed infodsagar closed 1 year ago

infodsagar commented 1 year ago

Converts Contact.jsx to Function Component

-Removes Component import no longer needs to do class extension

-Stores Contact function in const & removes render method

-Static defaultProps no longer required to define within the function

-Tried to pass values for the center and zoom as default parameters in the function but throwing error [Warning: Failed propType: Invalid prop of type object expected number with React]

-Console prints gives 'object' on console.log(typeof props.zoom) instead of 'number'

-Refers to React documentation on default props, I didn't wrap values in Curley braces that's why it was getting converted to an object

-Destructures default value in the function itself defaultProps() method removes

-Thanks Dave for pointing to the documentation

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
codesydneywebsite ✅ Ready (Inspect) Visit Preview Nov 30, 2022 at 9:54PM (UTC)