links in reactjs code example
Example 1: how to add links in react js
import React from 'react';
import { Link } from 'react-router';
class List extends React.Component {
render() {
return (
<div>
<p>Please choose a repository from the list below.</p>
<ul>
<li><Link to="/react">React</Link></li>
</ul>
</div>
);
}
}
export default List;
Example 2: link in react
<Link
to={{
pathname: "/courses",
search: "?sort=name",
hash: "#the-hash",
state: { fromDashboard: true }
}}
/>