-
What is the difference between props and state in React?
-
When would you use state instead of props?
-
Assuming
UserDetail
is a component, what will its props be if it's rendered as follows:const user = {name: 'Spider Man', age: 32} <UserDetail title="Profile Page" dog="Fido" user={user} />
-
Take a look at
https://learning.flatironschool.com
. Pretend you were going to recreate a specific page. What top level components would you have? What props would they receive and what state would they own? What components would they have as children?
Created
March 1, 2024 07:31
-
-
Save hiba-machfej/7ecdba8f9dd8f44ec9c26c187e89d067 to your computer and use it in GitHub Desktop.
# Discussion Questions: Props vs. State
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Team [ Papula , Halwest , Shkar , Shinak, and Nada ]
Assuming UserDetail is a component, what will its props be if it's rendered as follows:
const UserDetail = ({title,dog,user}) => {}
its props are title,dog and user(object)
Take a look at https://learning.flatironschool.com. Pretend you were going to recreate a specific page. What top level components would you have? What props would they receive and what state would they own? What components would they have as children?
Top-level Components:
Sidebar - Notification header - Dashboard - Right Section- Footer