Closed infodsagar closed 1 year ago
-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]
[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'
console.log(typeof props.zoom)
-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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
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