we can used react-router-dom and rect-scroll/module at same time in react.js? if yes then how to used?

268 Views Asked by At
import React from 'react'
import "./Navbar.css"
import { Link } from 'react-scroll/modules';
import { Link } from "react-router-dom";

In my project I need to use react-scroll and react-router-dom at time in react app but

import { Link } from 'react-scroll/modules';
import { Link } from "react-router-dom";

here show error for import Two package.

1

There are 1 best solutions below

0
On

You can import them like so:

import { Link as ScrollLink } from 'react-scroll/modules';
import { Link as RouterLink } from "react-router-dom";