React haqida malumotlar
Beknazarov Mirzobekga tegishli
Reactda fungsinal component bilan class kamponentasini farqi
Class componentasi
class App extands React.Component {
render() {
return(
Class Componentasi
)
}
}
Eslatma class componentasida props ni ishlatish uchun this kalit suzidan foydalanib ishlatiladi Masalan:
{this.props.name}
Fungsiya componentasi
const App = () => {
return(
Fungsiya Componentasi
)
}
Eslatma fungsiya componentasida props ni ishlatish uchun uni App componentasini ichida elon qilib ketish kk: Masalan: App = ({props}) => va keyin uni {props.name}
Do'stlaringiz bilan baham: |