pull/369/merge
Roopkumar Das 2 years ago committed by GitHub
commit 1f77660a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -69,7 +69,7 @@ const buttonWithStyle = (CompParam) => {
return <CompParam {...props} style={buttonStyles} /> return <CompParam {...props} style={buttonStyles} />
} }
} }
const NewButton = buttonWithSuperPower(Button) const NewButton = buttonWithStyle(Button)
class App extends Component { class App extends Component {
render() { render() {
@ -149,12 +149,12 @@ const buttonWithStyles = (CompParam, name = 'default') => {
} }
} }
const NewButton = buttonWithSuperPower(Button) const NewButton = buttonWithStyles(Button)
const ReactButton = buttonWithSuperPower(Button, 'react') const ReactButton = buttonWithStyles(Button, 'react')
const InfoButton = buttonWithSuperPower(Button, 'info') const InfoButton = buttonWithStyles(Button, 'info')
const SuccessButton = buttonWithSuperPower(Button, 'success') const SuccessButton = buttonWithStyles(Button, 'success')
const WarningButton = buttonWithSuperPower(Button, 'warning') const WarningButton = buttonWithStyles(Button, 'warning')
const DangerButton = buttonWithSuperPower(Button, 'danger') const DangerButton = buttonWithStyles(Button, 'danger')
class App extends Component { class App extends Component {
render() { render() {

@ -20,7 +20,7 @@
# Context # Context
Context allow as to pass data through the component tree without having to pass props down manually to every child component at every level. Context allow us to pass data through the component tree without having to pass props down manually to every child component at every level.
In React, data is passed top-down (parent to child) via props, but this can be cumbersome for certain types of props (e.g. locale preference, UI theme) that are required by many components within an application. Context provides a way to share values like these between components without having to explicitly pass a prop through every level of the tree. In React, data is passed top-down (parent to child) via props, but this can be cumbersome for certain types of props (e.g. locale preference, UI theme) that are required by many components within an application. Context provides a way to share values like these between components without having to explicitly pass a prop through every level of the tree.

Loading…
Cancel
Save