401 questions
0
votes
1
answer
354
views
way to prevent lag between conditional render svelte
In my svelte app, I have a conditional statement that goes something like this. "If the video source exists, render the Video component, else always render a default image". I am finding ...
0
votes
1
answer
1k
views
Conditionally rendering a component inside of <Draggable>, using react-draggable, is breaking the draggable functionality. Any ideas?
I'm trying to conditionally render a component inside another component that uses react-draggable. If my return function returns a div, dragging works fine. If my function returns SomeComponent, ...
0
votes
2
answers
661
views
Is there any alternative way to call a react hook conditionally?
Using react hooks inside any function of condition is invalid. Neither can I do conditional rendering for a hook. Is there any way to use a hook with emplement condition? Please share code
0
votes
1
answer
58
views
Conditionally rendered list in React is behaving with one method, but not another
I've got a list of products to render. I also have an array of keywords that are used to exclude products from being rendered.
I am looping over the array of keywords and checking if the product title ...
0
votes
1
answer
111
views
How to hide footer and menu when notfound page rendering in Router v6 [duplicate]
As you can see I want to hide menu bar and footer when notfound page is rendering .I tried all the other solutions but didn't happen to work in my Scenario. I wanted the Navbar and footer hide in 3 ...
1
vote
1
answer
382
views
How can I conditionally render this component based on whether or not there is data in localstorage?
I want MyList to render whatever is in localStorage (works great), however when there is nothing in local storage and I render the component, it renders empty. I would like to have a placeholder there ...
-1
votes
1
answer
2k
views
React js (jsx) ternary operator not working as required
I've passed a prop - {pov} to a component- Page
I also have two other functional components - VisitorPOV and OwnerPOV
if pov === 'visitor' , I want to render VisitorPOV Component else OwnerPOV ...
1
vote
1
answer
2k
views
How can I conditionally render tabs depending on the value of a field of a GROQ query?
I have a GROQ query where the result is an array of documents, of which one of the fields, "fieldName", can contain "a", "b" or "c". If the array contains any ...
0
votes
1
answer
544
views
VueJs - Conditionaly showing elements in table
I have pretty simple table of users here with only 4 cols, and i want to show a button for each user depending on his status 'isActive'. If user is active i want to show button with text 'disable' and ...
0
votes
1
answer
418
views
component not rendering after setState in React.js
I'm trying to render a component conditionally based on a particular state. The code below is inside of a mapping on another file. I have a setState const of open and whenever a user clicks the '...
3
votes
1
answer
9k
views
Vue 3 v-if not reacting to changes within a function
What works:
I want to render an element only if some boolean value is true using Vue 3. This is an example following the Vue 3 documentation and it works just fine:
Template:
...
<div id="...
2
votes
3
answers
199
views
Where is information stored on the client that React hides with conditional rendering?
I'm trying to determine how secure it is to hide information with conditional rendering in React.
In the following React code, I hide the information "nnn" if the user is not logged in.
...
1
vote
2
answers
2k
views
Vue v-show not working with v-for to hide v-list menu
I am trying to hide an admin menu using v-show. In the code below the isAdmin value is false, yet the menu still shows. I have also tried v-if but that doesn't work either.
<v-list v-show="...
0
votes
1
answer
108
views
Weird React rendering behavior when deleting div from list
The React application I'm building has a TaskPanel component that uses a list of task names from its state to render a list of divs with Task components. The TaskPanel component uses this function in ...
1
vote
1
answer
840
views
render conditional sidebar in react by roles
I'm trying to filter items in a sidebar according to roles, I tried to do a conditional render in the login submit but I think it didn't work for me, I logged in and showed the items according to role ...
0
votes
2
answers
445
views
React - Extra table row printing incorrectly
I am looping through an array of objects, then based on a condition I am display that row in one Table or the other. However, when i call that condition, the object reacts how I would like (it ...
0
votes
1
answer
142
views
how can we use two fetch requests at a time
I am trying to do a prediction on a model using a rest API and show the output on frontend using react.
If the prediction is 1 then I need to display the second prediction using conditional rendering.
...
0
votes
1
answer
3k
views
React conditional render for logged in / logged out User only updates state with browser refresh
I'm building a React app using hooks and functional components for the front end to a Rails backend API with Cookie / Session authentication. Everything is working well as far as getting users logged ...
0
votes
1
answer
40
views
React how to use data.props content to do conditional rendering
I have a small question but I can't figure out how to perform it and how to find an other related post. Basically I want to display the instagram part only if there is {d.socials2}, otherwise I want ...
0
votes
1
answer
70
views
How can I better conditionally render my components?
I have a lot of components being rendered based on different states that I'm using for a game. I'm currently using the method where I check the value of state with ampersands. I'm not sure if there's ...
0
votes
1
answer
2k
views
How to use conditional rendering using class name in React? [duplicate]
import { display } from '@mui/system';
import React from 'react';
import "../user_config/user_page.css"
export default function FileUploadButton({showBtn, setShowBtn,value,...rest}) {
...
1
vote
1
answer
711
views
How do I conditionally render part of my CSS class
How can I make all of the css inside the following hover psuedoclass conditionally render when a variable (data) is not null? I have the following styles in my React Component (which uses Material UI ...
0
votes
1
answer
330
views
React Multiple Condition Check(JSX)
I've been trying to do some conditional rendering based on the user that is logged in. Is there a way in React JSX to check if more than one condition is true? I know this syntax is wrong but is there ...
1
vote
2
answers
1k
views
How can I render different component using onClick() function in React?
I am new to React and creating a Tic-Tac-Toe game. I want to create a starting page with three options :
Start
Rules
Exit
On clicking the start button I want to render the component which consists ...
0
votes
1
answer
190
views
Conditional rendering to choose display setup
UPDATE
I found a different solution- the page "responsiveness" wasn't working.
after adding:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
...