Show Menu
Cheatography

React Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

React

What is the difference between <a> and <li­nk> Tag?

React

What is the difference between <a> and <li­nk> Tag?
what is JSX?
when you are already in a route that matches what the Link points to. Say we are currently on /page and the Link points to /page or even /page/:id, this won't trigger a full page refresh while an <a /> tag naturally will
Javscript Expres­sions. It also makes easier to create React compon­ents. JSX allows to put HTML in javasc­ript.
Progra­mmatic Redire­ction in React Router
It can be achieved by <Re­dir­ect­/> Tag or histor­y.push from the history library in React Router. When a component is rendered by the React Router three props are passed to the components location , History and match. In which histor­y.push pushes a new route to the history stack aka routing the user to the new route.