In React " react-router-dom" v6 , " Switch " is replaced by routes " Routes ". So, you need to update the import from import { Switch, Route } from "react-router-dom"; to import { Routes, Route } from 'react-router-dom';
If you want add a video to a Bootstrap Modal and either dismiss or close the modal while the video is playing the video will keep on playing when you open again. So you can adjust this behaviour by adding in some JavaScript that acts to stop the video if either the modal window is clicked to close or the background is clicked to dismiss the modal. Add below JavaScript code in your files <script> jQuery(' #keredariModal ').on('hidden.bs.modal', function (e) { // do something... jQuery(' # keredariModal video ').attr("src", jQuery(" # keredariModal video ").attr("src")); }); </script> Note: Please replace your Model ID
Protected routes are very important for any web application. Below are the code to create authenticated routes that only certain users can access based on their authentication roles. import React , { Component } from 'react' ; import { BrowserRouter as Router , Route , Switch , Redirect } from 'react-router-dom' ; import commonService from './core/services/commonService' ; import './App.css' ; import Loader from './views/Loader/Loader' ; // Containers const FrontEndLayout = React . lazy (() => import ( './containers/FrontEndLayout/FrontEndLayout' )); const UserLayout = React . lazy (() => import ( './containers/UserLayout/UserLayout' )); const loading = () => < Loader /> ; class App ...
Comments
Post a Comment