unepod
August 11, 2021, 1:47am
1
Hello, and thanks for this awesome resource.
Not sure it’s the right thread, I want to signal that for this lesson:
“Review Using Props with Stateless Functional Components”
the suggested solution :
Review Using Props with Stateless Functional Components
Hints
Hint 1
A functional(a.k.a. stateless) component is just a plain javascript function which takes props as an argument and returns a react element.
Hint 2
Use Component.defaultProps to set default props.
Hint 3
Use Component.propTypes to set props types.
Solutions
Solution 1 (Click to Show/Hide) const Camper = props => <p>{props.name}</p>;
Camper.defaultProps = {
name: "CamperBot"
};
Camper.propTypes = {…
TL DR: defaultProps
on functional components will eventually be deprecated, so for future-proofing it’s worth using default parameters.
Sky020
August 11, 2021, 1:10pm
2
Welcome there,
Thank you, for taking the time to discuss this. I just want to link to relevant past discussion around outdated topics:
The Long and Short
The current curriculum version is old, but the next version (7.0) is being worked on.
In web development, it usually takes hardly any time for a well-covered topic/tool to be outdated , but the knowledge is not useless.
We are not updating the current curriculum lessons past bug fixes, because there is little bandwidth to do so, and even less benefit.
Hope this helps
2 Likes
system
Closed
February 10, 2022, 1:10am
3
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.