When I figured I would use Visual Studio Code to get a new React JS application started with learning it etc.. I ran across Microsoft site https://code.visualstudio.com/docs/nodejs/reactjs-tutorial In which this shows to
import registerServiceWorker from './registerServiceWorker';
Meanwhile, there doesn't exist, when I create a new react app it has an index.js file with
import * as serviceWorker from './serviceWorker';
//
serviceWorker.unregister();
- I don't like learning something that is outdated /deprecated so quickly … Is there a much better up to date place to figure out what I am supposed to do to be learning and productively engaged with React JS?
- Seems that
registerServiceWorker();
was common but is this completely outdated? What does registerServiceWorker do in React JS? - I want to really just get into calling Restful endpoints of web api, what is a good place to do find best practices to do this?
The serviceWorker support is a part of Create React App (the CLI tool, not React itself). Its official docs are a great place for up-to-date information:
As for learning React, while there are a number of great tutorials out there, you can rely on the official tutorial to always reflect the latest version.
React, being just a view library, doesn't prescribe a standard way to make HTTP requests. You can use any popular request library or just plain old Fetch API, and React will play nice with it.