From 2fe8e31d52f9baf5a516ae33575e531b94840fa4 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Wed, 20 Sep 2023 07:26:49 +0600 Subject: [PATCH] wip: add comment and state --- src/data/question-groups/react/react.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/data/question-groups/react/react.md b/src/data/question-groups/react/react.md index 0a6c2b1fd..aec9d31aa 100644 --- a/src/data/question-groups/react/react.md +++ b/src/data/question-groups/react/react.md @@ -277,4 +277,19 @@ questions: topics: - 'Core' - 'Beginner' + - question: How to write a comment in React? + answer: | + You can write a comment in JSX by wrapping it in curly braces and using JavaScript's multi-line comment syntax. + ```js + {/* This is a comment */} + ``` + topics: + - 'Core' + - 'Beginner' + - question: What is the difference between stateful and stateless components? + answer: | + The main difference between stateful and stateless components is one has state and the other doesn't. Stateful components keep track of changes to their state and re-render themselves when the state changes. Stateless components, on the other hand, render whatever is passed to them via `props` or always render the same thing. + topics: + - 'Core' + - 'Beginner' ---