JSX
const Question = ({ question }: QuestionProps) => {
const [upVotes, setUpVotes] = useState(0);
const upVote = () => setUpVotes((v) => v + 1);
return (
<div>
<h4>{question.title}</h4>
<p>{question.text}</p>
<p>{question.hours} hours ago</p>
<UpvoteBtn onClick={upVote} />
<Answers
numAnswers={question.num}
/>
</div>
);
}
export default Question;Umwandlung
Regeln
Generelle Regeln
Unterschiede: JSX vs. HTML
Last updated