React and react.js are one and the same It is responsible only for the view layer of the application It lets developers compose complex uis from small and isolated pieces of code called components Reactjs is made up of two parts, first is components, which are the pieces. A js file is a javascript file extension, this is used for any modules and snippets of code made in pure javascript You should use js files when writing functions that won't use any react feature but will be used among different react components
Jsx is a file syntax extension used by react, you can render component, import css files and use react hooks among other things React.js is ui library to render and organize ui components When it comes to services that can help us add additional functionalities then we should create collections of functions, functional objects or classes. The react library then translates that virtual dom into a ui users can interact with, and that it will update as the application state changes Since it's running in the browser, it builds an html input element Then, your user tries to actually interact with that input element
As for import react, { component } from 'react', this does not start with a./ or./ or / therefore node will start looking for the module in the node_modules in a specific order till react is found For a more detail understanding, it can be read here. However, when i tried to put my js in a separate file, i started getting this error I tried adding /** @jsx react.dom */ to the top of the js file, but it didn't fix anything.
OPEN