Archives : January-2021

I am using Leaflet with Windy in React via CDN which works fine: in index.js: <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> <script src="https://api.windy.com/assets/map-forecast/libBoot.js"></script> React component: export const renderMap = (): void => { const options = { key: ‘xyz’, lat: 41.3, lon: 2.1, zoom: 10, }; // eslint-disable-next-line @typescript-eslint/no-explicit-any (window as any).windyInit(options, (windyAPI: any) => { const { map ..

Read more

I have to redirect to the /user/dashboard page after login, but every time I close the tab and open it again it is opening the default home page i.e /. import React from ‘react’; import {isAuthenticated} from ‘../helpers/auth’ import {Route, Redirect } from ‘react-router-dom’; const UserRoute = ({component: Component, …rest}) => { return( <Route {…rest} ..

Read more

I’m trying to send props to a child component rendered with the tag from react router. I’m doing like this: This is how I use the Link element in the parent component (wrapped with the useRouter hook): […] <Link to={{ pathname: `/Element/${props.info.id}`, state: { info: "foo", }, }} > {title} </Link>; […] This is the ..

Read more