webahead14 / clinic-client

0 stars 3 forks source link

Radio question #2

Closed Karyum closed 2 years ago

Karyum commented 2 years ago

Your task is to create a component where a user can see a question and radio buttons (allowed to choose only 1 of them).

You will need to write the code in the <RadioButttonsQuestion/> component in the components folder, to see the component run the app and go to http://localhost:3000/survey/test/radio-question

Build the following question using this data:


const questionData = {
  questionText: 'Repeated, disturbing and unwanted memories of the stressful experience?',
  answers: ['Poorly', 'Semi-Poorly', 'Average', 'Semi-Strongly', 'Strongly']
}

Copy the code and paste it into the component. for the answers don't render them like so answers[0] answers[1] make sure to use .map() to render, there are a lot of examples out there of React components with .map()

Chosen value must be saved in a react state

radio-question