What is the Prop Getters Pattern?
Here's a quick overview of the prop getters pattern!
We'll cover the following...
Props Collection vs. Prop Getters Pattern
In JavaScript, all functions are objects. However, functions are built to be more customizable and reusable.
Consider the following:
Press + to interact
const obj = {name: "React hooks"}console.log(obj)
If you wanted to create the same object but allow for some level of customization, you could do this:
Press + to interact
const objCreator = n => ({name:n})
Now, this ...
Access this course and 1400+ top-rated courses and projects.