Just starting learning ReactJS. I'm trying to redirect using the Redirect component <Redirect to="/dashboard" />
. However, ReactJS is not familiar with this component by default (getting Redirect is not defined
on console log).
After some reading, I saw that the Redirect component needs to be imported (import React from 'react'
). However, since it's a web project, I do not use a webpack but rather import the entire library with:
<script crossorigin src="https://unpkg.com/react/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
So my question(s) is how do I use Redirect for a web project, or rather how to import components for a web project for ReactJS.