Videos
Facebook introduces Hooks in their 16.8 version and it works with only functional components so in some of the tutorials they have started implementing a new hook API so that's why you found functional components .w3schools have not updated their tutorials for Hook API.
I suggest you to start with HOOK API because it is easy to understand and also there is less memory leak compare to class base components and they solve many issues which was there in class base components.
You can refer below link for hook startup:
https://reactjs.org/docs/hooks-reference.html
You should put the errors here, but I see a big difference between the codes.
The w3school code is using a Class:
class App extends Component {
And you are using a function:
function App() {
Both codes are OK.
So... I need to know how are using the App component. It should be something like this:
import App from './App.js';
ReactDOM.render(
<App />,
document.getElementById('root')
);
If you are doing the same, try to put all your code in condesandbox (https://codesandbox.io/) and share it here!