import { useState } from 'react' import { IconSquareX } from '@tabler/icons-react' export default function EditCustomQuestions({dataRef, questionList = [], setQuestions}: any){ let questionTemp = questionList console.log(questionTemp) const [forceUpdate, setForceUpdate] = useState(0) function addQuestion(){ questionTemp.push({text: "", type:"text"}) setForceUpdate(oldFu => oldFu + 1) } function removeQuestion(index: number){ questionTemp.splice(index, 1) setForceUpdate(oldFu => oldFu + 1) } return <>

Edit custom questions!

{ questionTemp.map((question: any, index: number) => { return(
{questionTemp[index].text = e.target.value}}/> removeQuestion(index)} className="w-12 h-12"/>
) })}
{/* if there is a button in form, it will close the modal */}
}