<Route path='/posts' element={<PostsPage />}>
<Route path='/posts/:id' element={<Post/>}/>
</Route>const { id } = useParams(); {variation === 'primary' &&
<button className={styles.button__primary}>
{text}
</button>
}
{variation === 'secondary' &&
<button className={styles.button__secondary}>
{text}
</button>
} useEffect(() => {
(async () => {
try {
setIsLoading(true);
const {data} = await axios.get(url);
setData(data);
setIsLoading(false);
} catch (error) {
alert('Ошибка при запросе данных :(');
console.error(error);
}
})();
}, []) addSearchAction(state, action){
state.value = action.payload;
}