Skip to content

Tag: reactjs

using multiple libraries in react

so my question is I have a react application in this application I used material UI for only two components and I installed npm i @materialui/core so basically, I installed all material UI library but I only used 2 components of that big library will this cause my application to have bigger bundle size or whe…

Logo float on basic responsive nav

Problem ” float: right” poorly working in responsive class Basically, I am trying to place my image logo in the right-up corner for a semi-lang case but every manipulation on .logo force navigation bar to change its values. Question How can I align the logo to the right-up corner? What I’ve …

Wait for browser to render element in React

I’m using CSS transition with top and left to animate the movement of an element in React. To achieve this, the component must first be rendered with top: 0; left: 0, and then re-rendered with altered top and left properties to start the transition. This is my component: I expected the component to be r…

Find array object by ID and return it in React

I try to fetch object vorlagen with ID 6310 from this API and want to show if property vorlageAngenommen is true or false. The JSON object looks as follows: My code that does not run, looks as follows (I am not sure if this is a good base at all): I created a sandbox as well that can be found

React not getting different images for same URL

I am making a users page with arbitrary data and noticed that since the image URL is the same (https://source.unsplash.com/random) the image is the same. How can I prevent this? Answer That is because, your browser caches your url and assumes you are hitting the same url so it populates previous result. Add a…

Prevent infinite loop in useEffect when setting state

I am currently building a scheduling app. If a user selects two dates, I am attempting to select all date blocks between the two selected dates in the calendar as well. I am able to achieve this, but it causes my useEffect to fire into an infinite loop because I have state as a dependency in my useEffect wher…

Output data from form on the page react

I am writing todo app. There are main files in my directory now: App (rendering main page with header and buttons) TodoForm (create a form) TodoBox (generating list of tasks) And the question is: how I can pass the state from TodoForm to TodoBox in App (it is initialize as an empty array now). I want to outpu…