Add react-router-dom install step to React tutorial#3124
Open
fibibot wants to merge 2 commits into
Open
Conversation
The "Add a router" section imported react-router-dom in three files without ever telling the reader to install it, so following the tutorial verbatim produced unresolved-import errors. Added the deno add command and a short explanation of what BrowserRouter, Routes, and Route do, including how the :selectedDinosaur path parameter flows to useParams() in Dinosaur.tsx.
Contributor
Author
|
@bartlomieju ready for review when you have a moment. |
bartlomieju
reviewed
May 14, 2026
Member
bartlomieju
left a comment
There was a problem hiding this comment.
Looks good, remove em dashes
lunadogbot
approved these changes
May 16, 2026
Contributor
lunadogbot
left a comment
There was a problem hiding this comment.
CI is green and the added deno add npm:react-router-dom step matches the later bare react-router-dom imports. No blockers found.
Contributor
|
@bartlomieju this is ready to merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Add a router" section in
examples/tutorials/react.mdjumpedstraight into
import { BrowserRouter, Route, Routes } from "react-router-dom"without ever telling the reader to install the package. A user
following the tutorial verbatim hits an unresolved-import error as
soon as they save
App.tsx— the package isn't in anydeno addcommand on the page, even though it's in the upstream
tutorial-with-reactrepo'sdeno.json.This adds the missing
deno add npm:react-router-domstep and ashort explanation of what
BrowserRouter,Routes, andRoutedo,plus how the
:selectedDinosaurpath parameter flows through to theuseParams()call inDinosaur.tsx— which previously appearedwithout motivation.
Verified by running
deno add npm:react-router-domagainstdenoland/deno:latest(deno 2.7.14) in a clean directory; itresolves to
react-router-dom@7.15.0and writes a cleandeno.jsonimports entry. No code blocks were changed, so the rest of the
tutorial is unaffected.
Closes bartlomieju/orchid-inbox#46