Pratik Vyavahare
Pratik Vyavahare

Reputation: 61

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

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.

Upvotes: -1

Views: 291

Answers (1)

omercotkd
omercotkd

Reputation: 585

You can import them like so:

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

Upvotes: 1

Related Questions