React-router: What`s the difference between handler and component in Route props

Created on 12 Jan 2016  路  2Comments  路  Source: ReactTraining/react-router

I saw some demo in web and found the Route component has two props to define the componet name when path matched.
some of them use _handler_ and others use _component_.
Just like this

<Route path="home" name="home" handler={Home} />
// or
<Route path="home" name="home" component={Home} />

which one is correct?
I saw the docs. Buy no mention.
THK.

Most helpful comment

handler is deprecated in v1.0, you should use component.

All 2 comments

handler is deprecated in v1.0, you should use component.

Thanks for your question!

We want to make sure that the GitHub issue tracker remains the best place to track bug reports and feature requests that affect the development of React Router.

Questions like yours deserve a purpose-built Q&A forum. Could you post this question to Stack Overflow with the tag #react-router? https://stackoverflow.com/questions/ask?tags=react-router.

We also have an active and helpful React Router community on Reactiflux, which is a great place to get fast help with React Router and with the rest of the React ecosystem. You can join at https://discord.gg/0ZcbPKXt5bYaNQ46.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

winkler1 picture winkler1  路  3Comments

ryansobol picture ryansobol  路  3Comments

Waquo picture Waquo  路  3Comments

nicolashery picture nicolashery  路  3Comments

imWildCat picture imWildCat  路  3Comments