What is ‘reloadDocument’ prop ?
This prop controls whether a full page reload should occur when the link is clicked. setting it true will reload the page which can be useful in certain cases.
Syntax of ‘reloadDocument’ prop:
<Link to = "/contactUs" reloadDocument = {true}>
Contact
</Link>
Link Component in React Router
React Router is a powerful library in ReactJS that is used to create SPA (single-page applications) seamlessly. One of the components of the React Router is Link.
In this article, we will be seeing the working of the Link component, various props, and usage of the Link component within React Router in developing Single Page Applications.
Table of Content
- Working of Link Component:
- What are Props ?
- What is ‘to’ prop ?
- What is ‘reloadDocument’ prop ?
- What is ‘replace’ prop ?
- What is ‘preventScrollReset’ prop ?
- Parsing Attributes
- Use of Link Component