reactjs / reactjs/react.dev

Tutorial recommendation of naming stylesheet index.css causes problems

Open
#5,366 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

The React Tutorial (https://reactjs.org/tutorial/tutorial.html#setup-option-2-local-development-environment) includes the instruction

  1. Add a file named index.css in the src/ folder with [this CSS code]

This stylesheet is ignored. Upon perusing the generated file structure in Google Developer Tools, I discovered that another index.css (apparently generated by Webpack) had overwritten this one.

Giving the stylesheet another name (e.g. myapp.css) solves the problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the React Tutorial's Setup Option 2 section and its instruction to create src/index.css. Verify the reported conflict with the generated Webpack stylesheet, then update the tutorial's stylesheet naming guidance if confirmed. Done means the tutorial no longer causes the user-authored stylesheet to be ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript, react, webpack
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.