I am using an API for getting some data but the data it's returning this kind of values ' ; " ; instead of proper characters. How can I get the data having proper characters? I have seen a solution using jQuery .html() function but how can I do it without using JQuery?
// Here I have defined the type of the data I an getting
export type QuestionType = {
question: string
answer: string
option: string[]
}
// here I have defined a state to store data
let [quiz, setQuiz] = useState<QuestionType[]>([]);
// now getting the data from API
useEffect(() => {
async function fetchData() {
const questions: QuestionType[] = await getQuizDetails(5, 'easy')
setQuiz(questions)
}
fetchData();
}, []);
// component in which I am sending the data to
<QuestionCard
options={quiz[0].option}
question={quiz[0].question}
/>
//here's how I am using it in QuestionCard component
<h6>{question}</h6>