My Java Full Stack Journey Learning (Props) in React JS



This content originally appeared on DEV Community and was authored by Saravanan s

WHAT IS PROPS

Props are like arguments you pass to a function but there you pass them to a components .

they allows to send parent components to child components.

Props are read only – the child components cannot change.

why:
To reuse components with
different data
To make components dynamic instead of hardcoding values (change output based on input)

When:
when a child components needs data from its parents components
when you want to reuse a component with different data
when your ui should change dynamically based on inputs


This content originally appeared on DEV Community and was authored by Saravanan s