Skip to main content

Questions tagged [conditional-rendering]

Conditionally choose which jsf tags to convert to DOM

conditional-rendering
-1 votes
1 answer
40 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 ...
Rocky's user avatar
  • 117
0 votes
0 answers
35 views

What is an intercepting route in Next.js?

After reading the official documentation, I still didn't understand Next.js intercepting routes. Given: My questions: When we navigate to /photo/id1, do both page.js files get rendered? When we ...
Chong Lip Phang's user avatar
0 votes
1 answer
34 views

how to keep constant variable on react rendering

i've got stuck in react problems. I've create an online shop (front-end) website in react const products = [ { id: 1, name: "Oppo", price: 200, unit: 1, img: "oppo.jpg" }, { id:...
user25549839's user avatar
0 votes
0 answers
43 views

React Navigation Material Top Tabs Navigator conditional rendering blank screen on iOS

I'm experiencing this issue with my Expo React Native app on iOS only where a blank screen is displayed after swapping the Login screen with the Main screen based on simple component state change, e.g....
nvbach91's user avatar
  • 176
0 votes
0 answers
53 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 ...
Deivid Micael's user avatar
0 votes
1 answer
21 views

Conditional rendering not working for flutter widgets

Inside the build method 👇🏽 Widget build(BuildContext context) { final provider = Provider.of<StateProvider>(context, listen: false); // Get the selected question details from the ...
Dumindu Jayasekara's user avatar
0 votes
1 answer
65 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 ...
ledmatrix's user avatar
0 votes
1 answer
34 views

Unexpected behaviour when conditionally rendering the same input component with different defaultValue

NOTE: this question aims to understand why this code gives this behaviour, not what alternative code would give the desired one. I have a custom component to represent a particular form field, and I ...
Manuel Lera Ramírez's user avatar
0 votes
0 answers
36 views

Render different pages on same route but for different subdomains in a single nextjs app

I have a nextjs 14 frontend app, a python fast api backend. I have app router implemented in the app. I want to create a different website on store.myapp.in which is different from dashboard.myapp.in ...
moin bhokare's user avatar
0 votes
0 answers
351 views

how to know if the app is on the not found page in nextjs 14 app router

I'm encountering difficulty determining if my Next.js application is on the 404 not-found page within the app router. I have a functioning 404 not-found page that displays when the URL doesn't match ...
Abdul Vahid's user avatar
0 votes
1 answer
48 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'> ...
Anthony Onah's user avatar
0 votes
3 answers
76 views

Render React child component with conditional rendering and one general wrapping html element

I have a React component: const Options = () => { // Option logic if (isOptionOne) { return <OptionOne />; } if (isOptionTwo) { return <OptionTwo />; } if (...
meez's user avatar
  • 4,530
0 votes
2 answers
37 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. ...
Herbie's user avatar
  • 1
0 votes
0 answers
46 views

Media Viewer in React: Displaying Single and Multiple Images from Firebase Storage

Problem Description I have a list of media items retrieved from Firebase Storage categorized as usersingleMedia and usermultipleMedia. The media can be a single image, a single video, or a folder ...
Dilip Kumar's user avatar
-1 votes
1 answer
63 views

Is component duplication for responsive display in react a good idea?

I am trying to display a component called 'BillingInfo' on my checkoutpage in react . using tailwind css. <Checkout> //some complex layout //container 1 <div > /** other ...
Ranjeet Thorat's user avatar

15 30 50 per page
1
2 3 4 5
27