Relative Content

Tag Archive for javascriptreactjstypescript

Setting onClick within template string

I am working on setting an onClick within a template string. The button is rendering as expected, but I am not getting my console log as I expect from the button click. I am basically running a server response through a parser and based off of what I getting back I am either rendering a button or an anchor tag. The button will launch a modal, while the anchor tag will just take the user to another link.

‘Routes’ refers to a value, but is being used as a type here. Did you mean ‘typeof Routes’?

import { Route, Routes } from “react-router-dom”; const AppRoutes = () => { return ( <Routes> <Route path=”/” element={<span>Home Page</span>} /> </Routes> ); }; export default AppRoutes; Here’s the code (https://i.sstatic.net/21ZT7tM6.png) (https://i.sstatic.net/7EYp6weK.png) ‘Routes’ refers to a value, but is being used as a type here. Why this is not working … javascript reactjs typescript New […]

All environment variables at the top of JS file (Hide them?)

I am calling a few environment variables in a js file that I am calling in the root of my project. Everything is working as expected, but I have noticed one thing that seems off to me. If I go into the console and open up that js file from source then every environment variable is at the top of the js file where I called a few of them.