-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Early Preview] New React Documentation #3965
Conversation
Bug report: on iOS in Mobile Safari I can type to edit the examples and it mostly works, but the "return" key fails to insert a new line for some reason (see how I'm pressing the return key here and it's not working) FullSizeRender.mov |
You have included an API key in this PR in one of your config files |
Just some immediate organizational feedback: Since the sidebar is on the left now, that's where my eye is drawn first (ahead of the page content). Hence, when I saw this: It looked rather barren to me. I don't know if it's the tab design, but it was non-obvious that the majority of the content I'm looking for is behind that Learn tab. I would do one of the following:
Honestly, I think combining Home and Learn is best. There's not much content on that tab anyways, so combining it with Learn doesn't create something too huge. Home also has content I'm not likely to be going to the docs for. I want to get info on a feature or API, not meet the React Core Team (no offense! I already know who you are 😄). Perhaps you have more stuff planned for that section, which may make this a moot point. Still, I think it would be helpful to have the most likely destination immediately visible on page load. Anyways, I hope that's helpful! |
Do you mind sharing which one? I assume it's probably intentional, e.g. Algolia needs one for search. Feel free to mail me |
Home has very little content now, but we will later move Blog and a few other things there. So it seems a bit premature to restructure before we know how the rest of the things will look together, as we might have to split it back up. There will also be a different landing that will help decide "where to go" as well. But yeah, we'll definitely want to revisit the top-level grouping after 80% of the content is there. |
@gaearon Ah sorry for the false alarm, yes, it was Algolia. I have to admit I didn't bother to check what it was (it's sleeping time here) |
No worries, appreciate the diligence :) |
On a small screen like a smartphone, the line numbers overlap with the body of the code when scrolling horizontally, so I think the background of the line numbers should be colored. RPReplay_Final1634870477.MP4 |
Oops. Pretty sure I broke it ... today. Thanks. |
So happy this has landed 💙💙💙 Just noticed that with a mouse plugged in (macOS, Safari 15.4), the nav scrollbar is white. I don't know why this is the case, because when the content expands to fill more than 100vh it disappears and is dark again. Also, dark mode selection does not persist. Would like it to be stored in localstorage or something. |
I want to move a discussion from Reddit here because I'd love to hear more people's thoughts about this problem.
My response:
To be clear, Quick Start itself doesn't have several chapters — it summarizes the chapters. That page is a summary of the entire site. You can "dive deeper" to a chapter (example chapter), which summarizes each page (example page) in it. And then you can dive deeper into the pages you find interesting. So the idea behind this organization is to let you "zoom in" and "zoom out" of content. Each individual page is pretty detailed, so chapter index and site index are meant to let you skim through it (and decide whether you need to dive deeper or not). But I know this idea is pretty polarizing so maybe we'll replace it by a regular short "list of chapters". The downside of that would be that there's no way to skim through the entire site/chapter's content without actually visiting every page.
On the contrary, index design is something we're very open to changing. I just hope we can come up with something better than a plain list of pages because that would make skimming very difficult. I've edited the announcement to clarify we'd love to hear more feedback on that. One possible alternative approach we've been considering is to move all the "skimming" content into a separate subsection, like a React Crash Course, while keeping the indexes short and to the point. Then you decide which way to go. I'd love to hear more thoughts on this. I feel like this criticism is very valid while also being a fan of "zoomable" content and not sure how to find the right balance and architecture here. |
(I will be cancelling builds despite merge because the deployment setup is.. not ideal. :P I need to figure out how to have two sites with different frameworks in one repo without them breaking each other. Something to do next week.) |
src/pages/learn/index.md
Outdated
|
||
### React uses JavaScript | ||
|
||
With React, you will describe visual your logic in JavaScript. This takes some practice. If you're learning JavaScript and React at the same time, you're not alone--but at times, it will be a little bit more challenging! On the upside, **much of learning React is really learning JavaScript,** which means you will take your learnings far beyond React. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little typo:
With React, you will describe visual your logic in JavaScript.
I noticed the same white scrollbars in dark theme (Chrome 95, Windows). I was able to fix it by setting |
Personally I like the new page structure, though the blog feels a bit out of place in the sidebar. Perhaps it should be its own tab like the other three sections. |
https://beta.reactjs.org/learn#chapter-2-overview-adding-interactivity Why are the code examples full of state-staleness prone code? const [person, setPerson] = useState({
firstName: 'Barbara',
lastName: 'Hepworth',
email: '[email protected]'
});
function handleFirstNameChange(e) {
setPerson({
...person,
firstName: e.target.value
});
}
function handleLastNameChange(e) {
setPerson({
...person,
lastName: e.target.value
});
} shouldn't it be...: function handleFirstNameChange(e) {
const firstName = e.target.value;
setPerson((person) => ({
...person,
firstName,
}));
} |
I think the "Quick Start" and "Describing the UI" titles could use some work. To the first, I don't think it adequately summarize its contents. My assumption when reading "Quick Start" is that this section will tell me how to write and run a simple app in as few words as possible. The reality though, is that it feels more like a more considered introduction or overview that will allow me to gain a foundational understanding for what React is and how I should use it before actually running anything. Not inherently bad - just not what I expected. To the second, from an inclusivity perspective, the use of the UI acronym in the title doesn't feel right. Most people will know what it means, but it feels like there ought to be a better way to summarize the content. Especially when in the first sentence of that page, the full term is used and then followed by the acronym:
|
flushWrapper('last'); | ||
|
||
return ( | ||
<article className="h-full mx-auto relative w-screen min-w-0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A horizontal scrollbar shows up on every page because of the w-screen class. There's probably a margin or something higher up, and the content stretches outside of the page.
Quick fix:
<article className="h-full mx-auto relative w-screen min-w-0"> | |
<article className="h-full mx-auto relative min-w-0"> |
src/components/Layout/Page.tsx
Outdated
<MenuProvider> | ||
<SidebarContext.Provider value={routeTree}> | ||
<div className="h-auto lg:h-screen flex flex-row"> | ||
<div className="h-auto lg:h-full overflow-y-scroll fixed flex flex-row lg:flex-col py-0 top-0 left-0 right-0 lg:max-w-xs w-full shadow lg:shadow-none z-50"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change overflow scroll to auto, the scrollbar will be visible only when needed
<div className="h-auto lg:h-full overflow-y-scroll fixed flex flex-row lg:flex-col py-0 top-0 left-0 right-0 lg:max-w-xs w-full shadow lg:shadow-none z-50"> | |
<div className="h-auto lg:h-full overflow-y-auto fixed flex flex-row lg:flex-col py-0 top-0 left-0 right-0 lg:max-w-xs w-full shadow lg:shadow-none z-50"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change overflow scroll to auto, the scrollbar will be visible only when needed
This was my first instinct too, but it's important because with the expanding categories you don't want the content to change width on expand. Having the scrollbar always visible solves that issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scrollbar-gutter is not very well supported yet, but it could be worth to go the extra mile to use overflow-y: auto; scrollbar-gutter: stable
for browsers that support it and for those that don't, overflow-y: scroll
.
Congrats on the beta release, really enjoy the interactivity of the docs! ❤️ I have some feedback regarding the search. I saw that I can use Maybe it would make sense to put the search into the middle of the page when opened with Here is a comparison of the search bars after hitting
|
@gaearon
Nothing is said about writing state during render, while about ref both read and write are mentioned. Why info about writing state during render is omitted from the table? (maybe I am allowed to write but inside I had similar comment from here, says: "not change any objects or variables that existed before rendering—that would make them impure". Does this include state variables? What about Would be nice if we get some feedback on our comments, maybe at least "reaction"- otherwise it feels sometimes it is waste of our time. |
src/pages/learn/thinking-in-react.md
Outdated
|
||
<Intro> | ||
|
||
React can change how you think about the designs you look at and the apps you build. Where once you might have seen a forest, after working with React, you will appreciate the individual trees. React makes it easier to think in design systems and UI states. In this tutorial, we'll guide you through the thought process of building a searchable product data table with React. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not immediately clear to me what this sentence means: "Where once you might have seen a forest, after working with React, you will appreciate the individual trees."
What do forest and trees refer to in this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe they're referring to an idiomatic expression: "can't see the forest for the trees".
Even so, I do agree that it's unclear how this expression/metaphor relates to the point they're trying to make: how React changes the way we think about designing apps. My best guess is that components-trees and the whole UI-forest, I.e. React allows us to see UI as a collection of components and pay attention on the latter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I think this doesn't work here and needs to change.
We always go through comments in batches. Right now there are bigger things to do than address each individual one. (For example, we need to set up the builds so that they don't fail, and figure out how to run deploys for both sites without breaking each other.) So please be patient. You can be assured we will read all the feedback but please don't count on fast responses at this time. Also, due to the volume of feedback we get (here and elsewhere), I don't think it's reasonable to expect that we will "thumbs up" every single comment. However, as I said earlier, we do read them all. |
Co-authored-by: Dan Abramov <[email protected]> Co-authored-by: Sylwia Vargas <[email protected]> Co-authored-by: Dan Lebowitz <[email protected]> Co-authored-by: Razvan Gradinar <[email protected]> Co-authored-by: Jared Palmer <[email protected]> Co-authored-by: Dane Grant <[email protected]> Co-authored-by: Dustin Goodman <[email protected]> Co-authored-by: Rick Hanlon <[email protected]> Co-authored-by: Maggie Appleton <[email protected]> Co-authored-by: Alex Moldovan <[email protected]> Co-authored-by: Ives van Hoorne <[email protected]> Co-authored-by: Brian Vaughn <[email protected]> Co-authored-by: Dmitri Pavlutin <[email protected]>
Co-authored-by: Lee Robinson <[email protected]>
Co-authored-by: Hao-Ping <[email protected]>
The `appId` was retrieved from props but the `<Search>` component is never instantiated with props. So the preconnect link targeted an unknown search cluster: ```html <link rel="preconnect" href="https://undefined-dsn.algolia.net" crossorigin="true"> ``` This fixes the preconnect link by getting the `appId` from the website config.
* fix: googleTranslate breaking terminal blocks * chore: prettier magic
This reverts commit 446c15c.
Thanks to everyone for commenting! We've decided to merge the beta website into a Since this PR is merged, to avoid confusion, we'd like to ask to direct all future feedback to #3308. We haven't had a chance to go through all feedback in this thread yet, but it's all recorded in our todo list, so we will be making a pass over it as we get closer to completion. |
We're kicking off the translation process in #4135. |
Since announcing the start of the new React documentation effort, we’ve been busy writing the content and building a custom website designed around the learning experience. We are now ready to share this early preview of what we’ve created so far to get your feedback.
This early preview is deployed at beta.reactjs.org and is in active development.
Please leave any feedback in #3308.
TLDR
Visit the early preview of the new React Docs at beta.reactjs.org to find:
You may encounter some broken links—pardon our dust! Some content is yet to be released!
What's in the beta
The beta has two major sections:
useState
page to get a sense of what’s coming.The landing page is a temporary stub and will be replaced closer to the end of the project. Similarly, the Home tab is a bit empty now—we intend to port over more things from the existing site, like Blog, after most of the remaining work is done.
Known issues
What’s next
We will make an official post on the blog and put up a banner on the existing site to let visitors know where to find the new docs sometime after gathering feedback from this soft launch.
Once we achieve content parity with the old site, we’ll be ready to switch over to this one and keep the old one archived at a subdomain. We'll figure out which pages to redirect to which site at that stage—for now it's too early to discuss a plan. We intend to document all the stable React APIs before we switch over. That includes classes—however, they will be described on a separate page, while most of the docs will use Hooks.
Please note that:
You can help!
beta
folder in themain
branch with the[Beta]
tag in the title.Where to leave feedback?
High-level feedback is more useful than e.g. typos since we'll be doing more editing passes on all the content (bug fixes for typos much appreciated!). We'd particularly appreciate feedback on how to organize the content (see #3965 (comment)).
Special thanks
Getting to this stage required a lot of effort from different people, whom we would like to thank and acknowledge. This includes:
We'd also like to thank countless alpha testers and community members who gave us feedback along the way. Your support and encouragement meant the world to us over this longhaul project!