<code lang="javascript">
const reactCustomComponent = (props) => {
const data = useSelector((state) => state.data)
const onClickBtnHandler = (event) => {
const response = асинхронный запрос(axios || fetch)
dispatch action'a, (response.data) || .then(res => {
dispatch action'a, (response.data)
})
}
return (
<>
<Button onClick={onClickBtnHandler} />
{
data && data
}
</>
)
}
</code>