I’m having an issue with identifying bottlenecks in render performance while working on a JSON viewer. With few elements, it performs well, but at a certain point it becomes annoyingly slow. Checking the profiler, it seems that elements are rendering fast enough, but I’ve noticed a few issues that I’m not sure how to pursue. Overview The app is a
Tag: reactjs
How can I create a hook that reacts to an event to load more data?
I am trying to create a functionality where if a user clicks on a LOAD MORE button, it returns more data. I already have some code done but every time I click on the LOAD MORE button, it removes the first 12 items and sets the new 12 items, but I don’t want that, I want to keep the 12
Changing an object value from a Class
I have a js file handling my css where I am trying to change the value of an object, but the value stays the same. I assume the “this.opacity” is only returning a reference and not modifying the actual object and I am unsure of how to make this object mutable. How would I go about changing this value? Answer
Moment object won’t increment by days when cloned and used with DateTimePicker
I have the following code: I am using the following React component to change the date: The info for the component is here: https://material-ui-pickers.dev/ When I change the date the date is not incremented by the number of days listed in the first block of code (I explain more in the comments) Thank you! Answer I reproduce and this works
Adding and deleting array of classes error
Below is my attempt to create an array of classes. The functionality of app is next: one can add or delete extra Input box and increase or decrease its value. As a result the app displays the sum of the all present tags. The issue comes with Delete function, when deleting any of components from created list it does correct
React: How do you lazyload image from API response?
My website is too heavy because it downloads 200-400 images after fetching data from the server (Google’s Firebase Firestore). I came up with two solutions and I hope somebody answers one of them: I want to set each img to have a loading state and enable visitors to see the placeholder image until it is loaded. As I don’t know
REACTJS how to load a page at the end of timeout?
Im new to REACTJS and trying to make a webpage for practice. I can’t figure out how to load a new page at the end of timeout. Basically what I am trying to do is to make the Main page load and then start a timer for about 5 seconds and at the end of the 5 seconds I would
React Native – Pressable – Can’t run sample code
i am trying to run the example code from react native you can find here: https://reactnative.dev/docs/pressable I allways get the error message: Warning: React.createElement: type is invalid — expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s%s, undefined, You likely forgot to export your component from the file it’s defined in, or you might
Too long title slide the menu button to the right outside of the card
I have a problem with MuiCardHeader For some reason too long title or subtitle slide the menu button to the right outside the card. How can I prevent it? Result I need Here is code sandbox https://codesandbox.io/s/dazzling-paper-5d35h?file=/src/App.js UPD: Solution Add the following code to .MuiCardHeader-content class Thanks to everyone for help! Answer You need to restrict the parent with text-overflow:
How to render the content of React Quill without the html markup?
I managed to get my Quill working, but now I wanted to display the contents from the editor without the html markup. I tried using react-render-html npm package, it was working fine before but now it is no longer maintained and gives me a error also it shows up with html markup. So i tried using react-html-parser , htmr ,