Skip to main content

All Questions

0 votes
2 answers
37 views

NextJS - Update data object being passed into Child Component based on Button Click

I need to know how to update a data object based on a button click. This data object is being passed into a Child Component. When a user chooses an option in the dropdown menu, I want to populate that ...
CodeNinja's user avatar
3 votes
1 answer
89 views

Make input field populate with today's date when user clicks on the select option

When the user clicks the option value "apple" for example, the input field should automatically populate with today's date. Here's my code import "./styles.css"; import React, {...
Katleho-codes's user avatar
0 votes
2 answers
3k views

How would I go about getting a value from a Headless-UI component?

I'm using a Headless-UI Listbox component. I put this listbox as it's own React component, and I import that component in a settings form. How would I go about grabbing the value from the component ...
hypercoded's user avatar
1 vote
2 answers
556 views

Cannot access value of state inside function body that's inside component

I am trying to access the state variable val inside my function addToFeed(). In the first line of code inside addToFeed(), the line console.log("Value of val: " + val) always prints out &...
Matthew Trent's user avatar
0 votes
2 answers
1k views

Passing session user data into a form to edit in react using nextjs

I have the following form, import { useState } from 'react'; import Head from 'next/head'; import { FormProvider, useForm } from 'react-hook-form'; import { useSession } from 'next-auth/client'; // ...
Ben Bagley's user avatar
8 votes
4 answers
4k views

next/link losing state when navigating to another page

I am developing a library Next.js application. For the purposes of this question, I have two pages in my application: BooksPage which lists all books, and BookPage which renders details of a book. In ...
fredperk's user avatar
  • 818