Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I’ve been trying to sort string inside an object which is inside an array. By splitting the string into array, I successfully sorted the array.
Tag: javascript
react-select default value set but not highlighted
When I set the defaultValue in the react-select Component, it is correctly recognised and set, but is not highlighted in the select menu. defaultValue selected Not highlighted in the menu This is the defaultValue, and it’s correct: Perhaps it is because the value is an object? Does anyone have any suggestions? Answer You are correct, the problem arrises because the
How to check if time passed (timer)
I have code: In the code I’m checking current time in milliseconds and in the form I write time in ms and sum current time with time in form and for example I want to add to current time 6000 ms and before this 6000 ms pass I want to pass for example to website information “ON” and after that
Why I’m getting CssSyntaxError of missing semicolon in Gatsby build?
I’m working on a Gatsby page using Material UI. The page design is almost complete, but when I’m finished, I get a strange build error on npm run build. I have no idea where this error is coming from, but I’ve spent several hours trying to resolve it with no success. Is anyone able to assist me with this? If
Vue 3 Append Component to the DOM: Best Practice
I would like to dynamically create a component in my Vue 3 app that I have in an SFC, and append it to the DOM. I am using <script setup> style components, which is yet another wrinkle. This seems unnecessarily hard. Here’s more or less what I want to do: Fetch some data. Got that. Make an instance of my
Socket.IO in React app bundled with Vite doesnt work (When bundled with Webpack it does)
I have a Create React App that I migrated to Vite. I use socket.io-client. Both versions of the app are exactly the same (simply copy/paste) except the bundlers. This is my websocket connection In the webpack version I can see in the network tab that socket.io is attempting to connect. But in the vite version it doesn’t, it doesn’t even
How to access object property with dynamic key in Typescript?
In my component Product.tsx I receive an object via API call that could look like this: I then render each variant as a row in a table where each column displays the price, size etc. as editable input fields. onChange of each input triggers updateVariant(variant.id, key, e); where key is one of the keys of a variant and e is
CASL Authorisation in a React app “Can” conditions have no effect
I am trying to implement CASL Authorisation in a react app, I think there is something I am not quite understanding about how to implement it. The standard Can components seems to work with the basic CRUD actions, but I have not been able to get the conditions to have any effect. I think I am missing something. My current
UnhandledPromiseRejectionWarning even though wrapped in try/catch()
I’m getting the following error message when trying to run storeDirectory(). Why doesn’t my catch() statement not catch the error that is thrown inside addFile()? My understanding is that errors bubble up to any “outer” catch statement but that doesn’t seem to be the case in my code. Answer try will only catch asynchronous errors if the Promise is awaited.
Delete button is not able to delete buttons. It is responsive in the console but nothing else
i’m having trouble using my delete button with my code. Instead of deleting an object, it creates a new one. code is under render items function. i’ve tried several things but it seems like my biggest problem is the placement of the rederItems function in the if statement. I also added the html to show you how that looks like