So I’m iterating an array with objects and checking for a specific id, and this works fine when It has an id, but some time that is null and when it is it throws an error can’t read properties of null or something similar. Here is my function, and I would like to check the case, if it is null
My input didn’t update value when I update state
I made two components, one is sign in component and one is form input. I pass props to form input to render some input form. And I also had a state to save the value of this inputs (two way binding). Rendering is fine till now. The problem when I submit form and set state to initial, i saw the
Why can I not overwrite the innerHTML after I once clicked into it
My Code: As you probably read, the code is for a Real-Time Texteditor Project I’m working on with a friend. But I don’t understand why everything works well until I click on the text field and wanna write something. The server gets everything and the other instance also. The only problem is, that …
‘Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘writeFile’)’ error while trying to write to a file with REACT
I am trying to write to a file with a button click inside my React application and it gives an error. My current code looks like this. Once I click the SYNC button it gives this error. This might be a noob mistake since I am new to this. I’d really appreciate if someone could help. Answer Your import st…
Best method to keep track of a users progression through reading sections of text
Similar to zyBooks if you are familiar with it, I want to track the sections the user has read through and checked completed with a button. However, conceptually I am having trouble thinking of what to store in my mongo database, besides just an object or an array of objects that contains each section and boo…
How to avoid repetition of CSS properties across multiple Web Components
I’m building with Web Component without any 3rd-party framework. And I have vanilla <button> in several of my components, and I have to reset EVERY ONE of them before I do my custom styling on them because resetting it once at a root level doesn’t work since the properties involved are not o…
Function to check if a given number do contain les than two different digits
I want to implement a function to check if a given number do contain les than two different digits, that are called duodigits For example : 12 , 110 , -33333 : are all duodigits , since they have no more than two different digits 102 : is not a duodigit since his digits ; 1 and 0 and 2
Strange red marking for style format in VS code 1.65.0
In my React Native 0.67.4 app, I just notice some red marking in some component’s js file. The red marking is only about the style sheets. Here is an image of the red marking: Here is the styles definition: The same red marking also appears for the format below: Here is the devDependency in package.json…
jQuery anchor links toggling a menu?
I used jQuery to make a toggle menu where someone can click on different span titles to toggle between different containers of content (on the website, this toggle menu toggles between different contact forms). The menu works, but I am trying to make it so that if a user clicks an anchor link on a different p…
Whats the best way to add an SVG to ReactJS
I want to create a component that displays an SVG in React. I am not having any luck, does anyone know a good practice for turns SVG’s into React components. I tried adding them to <img /> tags and <svg /> tags but i keep getting a broken image icon? Answer the best practice that I have foun…