I’m trying to declare a boolean from my firebase.js configuration file that depends on an if-else statement that checks whether a user is logged in or not. I want to store the log in status of a user in a boolean variable and export that variable across different components in my React app. So if user is logged in I
Tag: reactjs
Get src of dropped image from event target
I have a list of images that i can drap and drop, when dragging starts on image i store it’s URL in a state like this: When dropping it i use that state URL to display the image: But I was wondering if I could use the event e produced by onDrop to get the URL of the image, without
Calling async function in .map() (React)
I’m trying to iterate over IDs (track.id) and for each of them fetch some data (based on those IDs) from API (getBPM()). I’m pretty sure it’s connected with Promises and I’m not very fluent with these yet. Here’s the code: I’ve tried some things, but couldn’t get it to work. I’d appreciate any kind of help Answer When you call
Footer won’t stay at bottom of page and below content in React
I have a React application with this basic layout: My issue is that I have separate stylesheets for each of these components, but I can’t get my footer to both be at the bottom of the page, and always stay below content. That is, if the page is blank, the footer would still be at the bottom, and if there
Tailwindcss not rendering in ExpressJS/React app
I am trying to add TailwindCSS to my existing Express JS + React application. I have tried many different tutorials, such as this one https://tailwindcss.com/docs/installation for regular JS, and this one made specifically for Create-React-App https://tailwindcss.com/docs/guides/create-react-app . I later tried this tutorial for express js https://daily.dev/blog/how-to-use-tailwindcss-with-node-js-express-and-pug My project was initially made with Create-React-App, but I later changed everything to run
What does the :8 mean in Webpack’s output variables. filename: [name][contenthash:8]?
I’m configuring Webpacks output and i have run into some examples which have this unusual syntax added on the end. Ok now you see the :8’s after fullhash? what extra feature does it provide? My first guess was UTF-8??? But that’s just a stab in the dark. Answer So from a quick little search in the docs, I found this
Why React js receive multiple answer from server with Socket.io?
When emit a event to the websocket server, the server receive the event once and send a response, but the client receive the event multiple time: result expected result received client side: server side : Answer UPDATE: on the client side I got to put the socket.on(‘response,()=>{…}) in the UseEffect of the component and add a socket.off in the return
boolean state variable change causes parent component to disappear?
What I currently have is a parent component called WhatDo.tsx that has a button which should open a child component called AddToWardrobe.tsx, which is currently simply a form to be filled out. To do this, I’ve used a { boolean ? ( show AddToWardrobe component):(show button to open component)}. However, when I click on the button, instead of opening the
How to update large JSON objects? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 months ago. Improve this question The server sends me a data as JSON to descripe a product. A product consists of properties and nested arrays of properties, up to 4
React / Stripe / createPortalLink() with firebase v9
I’m using Stripe extension for Firebase with firebase functions. Since I refactored a bit my code for firebase v9 modular SDK, I’m getting the following console error with my Stripe createPortalLink() function: Here is my function: Can anyone please advise? Thanks Answer You need to use the getFunctions() and httpsCallable() functions in the new Modular SDK as shown below: Checkout