Я прочитал статью , написанную Дэном. В приведенном ниже примере
class ProfilePage extends React.Component {
showMessage = (user) => {
alert('Followed ' + user);
};
handleClick = () => {
const props = this.props;
setTimeout(() => this.showMessage(props.user), 3000);
};
render() {
return <button onClick={this.handleClick}>Follow</button>;
}
}
Почему props
не изменяется при изменении this.props
, так как оба указывают на одну и ту же ссылку?