async componentDidUpdate() {
const user = await fetch(`${url}/user_info?user_id=${this.props.fetchedUser.id}`, {
method: "GET"
}).then(res => {
this.setState({
loaded: true
})
return res.json();
})
this.user = user
}
UNSAFE_componentWillReceiveProps(nextProps)
, результатов не дало, и попробовалcomponentDidMount() {
console.log("nextProps", this.props)
}
const Home = ({ id, go, fetchedUser}) => (
<Panel id={id}>
<PanelHeader>Example</PanelHeader>
{fetchedUser &&
<Group title="User Data Fetched with VK Bridge">
<Cell
before={fetchedUser.photo_200 ? <Avatar src={fetchedUser.photo_200}/> : null}
description={fetchedUser.city && fetchedUser.city.title ? fetchedUser.city.title + ' ' + fetchedUser.bdate : ''}
>
{`${fetchedUser.first_name} ${fetchedUser.last_name}`}
</Cell>
</Group>}
{fetchedUser && data &&
<Group title="Navigation Example">
<Div>
<Button mode="commerce" size="xl" level="2" onClick={go} data-to="persik">
Show me the Persik, please
</Button>
</Div>
{
data
}
</Group>}
</Panel>
);
import bridge from '@vkontakte/vk-bridge'
bridge.send("VKWebAppInit")
TypeError: bridge.send is not a function