401 questions
0
votes
1
answer
33
views
Next.js Build error: I have customize the fetch to retrieve token from both client and server
I have customized the fetch in a Next.js app to get the token whenever a request is made. This is the function:
import { getNewAccessToken } from "./getNewAccessToken";
import { cookies } ...
1
vote
1
answer
139
views
Filters and Sorting not retaining in AG GRID React on re-render
I can't copy the whole code here.
So I have a react component in which I am using 2 blocks of code (dashboard and details). I am conditionally rendering both block. Block 1 contains an AG grid react. ...
1
vote
1
answer
34
views
Why do hidden elements change the size of vuetify select? (conditional rendering)
I have a vuetify select where I want to restrict the text when too many elements are selected.
So I used conditional rendering to just display what I want:
<v-col cols="auto">
<v-...
0
votes
1
answer
50
views
Conditional rendering of multiple tables in Vue.js
I'm building a Vue.js application that requires conditional rendering of multiple tables based on certain conditions. I have a set of flags that determine which tables should be rendered, and I'm ...
-1
votes
2
answers
95
views
How to pass a component and state value in React to render conditional data based on user selection?
I am working on a React project where I have two components, UserRules (Component A) and UserEmail (Component B). I need to pass the value of a state variable selectedVoucherOption from Component A to ...
1
vote
1
answer
37
views
Conditional Rendering of Controlled Components Giving a Blank Page When False
I've been working on my first React Project, a CV application where users can input their information and generate a CV. After the user submits the form, the form should disappear and the relevant ...
-1
votes
1
answer
270
views
React: How to check if a component returns anything or not ( using Javascript )
I'm using my components as below and I want to check if one of inner components is returning anything or not to make style decisions based on that.
<Grid xs={12} md={ Bar() ? 8 : 12 }>
<Foo ...
0
votes
0
answers
76
views
React State Update Not Reflecting Immediately in Conditional Rendering
I am working on a React component where I need to select an item from a list and update the state with the selected item's ID. I then want to conditionally render the selected item. However, I am ...
0
votes
1
answer
127
views
Next.js conditional rendering on small screens
I'm using a custom hook to render different elements on the page based on the screen size.
Hovewer during rendering there is a delay because of the useEffect hook. Elements that are rendered ...
0
votes
1
answer
65
views
Input element is not displaying
In my React app, I am trying to create logic for how my input elements should be displayed. I used the window.innerWidth for different screen sizes, as is seen below:
<div className='Trends'>
...
0
votes
2
answers
42
views
Re-rendering conditional buttons
This is for an interactive bible.
In the following code I have buttons that are being conditionally rendered based upon the buttons I previously clicked.
The code calls an API to retrieve the data.
...
1
vote
2
answers
80
views
Conditional styling not working as intended
Creating tabs always works well in React and this is working when opening in a browser, but the 'tabActive' styling is not removed when another tab gets clicked. 'tabActive' styling is getting applied ...
2
votes
1
answer
2k
views
How conditionally add an HTML attribute to an element in Astro
I am using Astro and TypeScript.
How do I add conditionally an HTML attribute rel="noreferrer" to an element in Astro?
So when targetBlank = false it doesn't render rel attribute in the dom?
...
0
votes
1
answer
85
views
jsx conditional rendering won't update on state change
I want to conditionally render jsx in my AuthForm component and i'm having trouble specifically with the 'isPasscodeEntry' scenario.
My AuthForm component conditionally renders an input form based on ...
0
votes
1
answer
41
views
React , when you add class remove other ones
I got a total of 3 conditions. When I add the class possible-links-cont-star-btn with the x.feature condition I want to remove the all other classes element have.
<Link
key={i}
onClick={() =>...
0
votes
1
answer
97
views
Trying to display different value depending on other values in React
I have this conditional rendering
{livematchcard.event.status_name != "Ολοκληρώθηκε" ? "Τελικό"
: (livematchcard.event.sport_id == 4 ? (
...
0
votes
2
answers
1k
views
React derived state. Whats wrong with this code
Coming from angular, i would like to know what's wrong with this code. I've been told that i should use useMemo (for the fitlering part) and useRef (to store products).
I know how to do that, but i ...
1
vote
0
answers
60
views
Conditional Rendering on BottomTab Navigator not working
So what i am trying to do is that I am doing conditional rendering of my AccountStack and AuthStack on my AccountTab, now my AuthStack contains screens Welcome, Login and Otp and after entering the ...
0
votes
1
answer
43
views
What is wrong with this React conditional rendering expression?
I had the below Reactjs snippet in our UI, which works fine now.
<Select
label="Send To"
labelId="send-to-label"
...
0
votes
1
answer
393
views
I am not getting data from api after refreshing the web page in next.js
I am working on a project, where I am using conditional rendering. I am not sure what the cause but I am not getting data from api after refreshing the page.
Image of the page on first load
Image ...
0
votes
0
answers
21
views
How to change my react webpage according to the button I am pressing on a static webpage?
I am basically creating an online game .I have set up an Express server which till now served static webpages . Now , I have static webpage which has two buttons 'Create Game' and 'Join Game'. Now, ...
1
vote
1
answer
28
views
VueJS Conditional rendering with v-show and json
I'm building a portfolio with VueJs and would display projects with selected tags.
Here is my code:
<script lang="ts">
import projectsData from "../projects.json"
export ...
0
votes
1
answer
165
views
Why is react-nestable rendering [object Object] instead of expected JSX?
I am trying to render custom JSX snippets based on the objects stored in an array in using react nestable. But instead of the JSX snippet, [object Object] gets rendered on the screen. Here is my code
/...
0
votes
2
answers
52
views
Cannot render third react component using conditional rendering
import React, { useState } from 'react'
const LoginPage = () => {
const [isLogin, setIsLogin] = useState(true);
const [isSignUp, setIsSignUp] = useState(true);
const [isAdmin, ...
2
votes
0
answers
188
views
React - Loading images in conditional rendering - performance issue
I have a React application in which after clicking on the buttons I change the categories and each category has its own layout with text and images.
The problem is that I conditionally render this ...