I have the following route config and in this example, I can get the id parameter in the StudentComponent by using the route functions. However, I need to pass this id parameter to the child route of this component, but I am not sure if I have to update the following config to pass this id parameter to the Ed…
Tag: javascript
aws cdk nextjs graphql mutation cannot return null for non-nullable type after adding in new schema field
I have tried to modify the schema to add a ingredients String line. From this code I am pretty much following it to a tee https://github.com/dabit3/next.js-cdk-amplify-workshop you can look in the backend and frontend folders to see all the code I have built and deployed with cdk My error is at the bottom Any…
Write a function that takes in an array of integers, and a string that will be either ‘even’ or ‘odd’
Im working on a problem in javascript where I am supposed to write a function that takes in an array of integers, and a string that will be either ‘even’ or ‘odd’. The function will count how many times 4 even or 4 odd numbers show up in a row. For example: so far this is where I am at…
HTML/Javascript slow/crashing on quiz app
I have a problem with my otherwise fully functioning quiz game. There seems to be crashing/slow loading issues after around 5 or 6 (out of 10) questions. Its very strange because if I answer everything within a second (unrealistic but to error check), there is no problem. But as soon as I take a “normal…
Canvas and JavaScript – Flowing word from right to left while waiting for keypress input
I’m new and I am trying to write my first program. In this snippet I try to flow a word from right to left and on the left move a bar to the right and when they collide a life will be taken. I also have a keypress event that strips the word of its corresponding character. The problem is
react-markdown and renderers with arguments
I am using React Markdown (https://www.npmjs.com/package/react-markdown) to render markdown content in my NextJS project. I have created a simple component named “ImageRenderer” and I need to pass an argument (in this case the slug) in addition props, to this component but I do not know how: My pa…
If buttons of item were inactive for 2 sec – make action
I would like to implement such logic: User clicks on “Plus” or “Minus” button. If the user don’t click at any of those buttons for 2 seconds, then we assume that current quantity should be sent to the server. Right now, I have three buttons: “Plus” – increments …
How to use Link and Route inside of condition term
So I am trying to move through pages in react, my goal is when I did validate the things I need (name, and number) the page will switch and I will be in another route. (without refresh the page). I tried to do it with window.location but its refreshing the page I cant use <Link> because I want to switch
React How to change view after click on button
I wouldlike to change my view when I click on one Button : For example when I click on the button 1, only View1 is active. If I click on Button 2 ==> View 2 If I click on Button 3 ==> View 3 PS : View1, View2 and View3 are component file (.jsx) Answer There are multiple ways to
Store word context objects in variable
Exploring word add-ins world. Want to create a list of paragraphs and navigate to each by click on it(some kind of table of content) Like that: I have created code(on reactjs, but it does not matter which framework to use) When I click on any button the callback is invoked, no errors in console, but the navig…