REACT features

DAPHNEY NEPTUNE - Jun 10 - - Dev Community

There are so much to learn about React, that I can’t even begin to explain. I am still trying to figure out if I like it better than JavaScript. But I do know I like the fact that you can use components in a specific way like building blocks to build our web application. We can write codes that looks similar to HTML. It makes it very convenient and easier to understand when it comes to writing codes. There are a lot of great aspect of React that I like so far but the one that I really find useful is being able to return more than one return within the function scope by using components. For example:

                   function multiply(){
                        return( 
                          10 * 2
                           2 * 5
                        )
                      }
Enter fullscreen mode Exit fullscreen mode

When we are using the regular function, you can only have one return. The above example will not work. But when using React bellow you can see you can return multiple return statements by using components. With these components, it allows us to use the wrapping method by using a div tag and now you are able to return more than one return.

                     function App(){
                         return (
                            <div>
                              <h1>Hi</h1>
                              <h3>Bye</h3>
                            </div>
                         )
                     }
Enter fullscreen mode Exit fullscreen mode

This makes so much more sense to me, because I struggle a bit with JavaScript. In JavaScript, I have to wright so many function codes to get different returns and it can got a little confusing for me.
Learning how to use react is still new to me and I Know with more practice I will have a better understanding of it. What is your favorite feature in React?

. .