Open krichter722 opened 5 years ago
ShoppingList, Square, Block, etc will be but in src/
folder, each with their own .js file (ShoppingList.js, Square.js, Block.js), the more components you make, you can create a folder in src/
called whatever you want and further organize, you would only have to update import paths then.
index.js will always render to index.html's #root id and will import Component.js
in index.js you will have your ReactDOM.render(
I typically use facebook/create-react-app
as a boilerplate for react projects (live-reload, etc.)
I'm trying to get started with the easiest example from the tutorial at https://reactjs.org/tutorial/tutorial.html#setup-for-the-tutorial for some hours now. I desperately looking for the location where to put the
ShoppingList
, Square`, etc. classes. I invested some time in understanding the terms, but it always falls back to the contradiction in the instructionsand
This is the same as
right (where the attribute original is still unclear because all files are original after creating the app with
npx
)? If not, I'm not getting it after reading it the fifth time.Furthermore, I don't find any instructions where to put the code in the tutorial. My only guess is
src/index.js
, but that doesn't lead to the code being displayed afternpm start
.I think that creating the app with content and then deleting it is a worse approach than build the application from scratch. Unfortunately, dependencies and tools like package managers seem to be already designed more as soon-to-be outdated rather than doing one good job for a long time in the "frontend world" - which is why most other tutorials on React going the way to build from scratch are outdated these days. The solution for this problem would be to simply put the tutorial commands in a CI script and test them periodically.