Answer the question
In order to leave comments, you need to log in
Is it possible to wrap Switch context in react?
Will props be caught from context in switch components? The task is to pass props to a neighboring component. or you need to take the parent above without routes ... Thank you!
<Context.Provider value="">
<Switch>
{/*страница главная*/}
<Route exact render={() => <Main/>} path={'/'}/>
{/*страница формы записи пользователей*/}
<Route exact render={() => <CreateUserModule/>} path={'/users'}/>
{/*страница админа*/}
<Route exact render={() => <Admin/>} path={'/admin'}/>
{/*управление розыгрышем*/}
<Route exact render={() => <Start/>} path={'/start'}/>
{/*статистика пользователей*/}
<Route exact render={() => <Statistic/>} path={'/statistic'}/>
{/*статистика призов*/}
<Route exact render={() => <Priz/>} path={'/bd'}/>
{/*страница lottery*/}
<Route exact render={() => <Lottery timer={timer}/>} path={'/lottery'}/>
</Switch>
</Context.Provider>
Answer the question
In order to leave comments, you need to log in
Is it really easier and faster for you to write a question than to try?
Можно
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question