reactjs / reactjs/react.dev

Where is the manual?

未關閉
#3,030 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
11.8k
分支
7.9k
平均合併
1 天 11 小時
30 天內合併 PR
11

描述

Environment: es6 hooks

I am fairly new to reactJS (3mths/500 hours) and struggling to find my way through the disparate collection of code samples and solutions in various corners of the opensource world, most of which appear to still be (even on your website) using the now-deprecated classes instead of hooks. As a programmer of some 40 years experience, on and off, I find the laissez-faire approach of the openSource world, when it comes to documentation, more than a little frustrating.

I find myself spending days to resolve straightforward issues, getting trapped in outdated methods or suggested solutions which just don't work. Searching for assistance rarely turns up anything from react.org and I dread the StackOverflow results which I have to wade through and which, more often than not, fail to provide a solution. This is not my idea of a professional working environment.

Even when solutions are provided, it would appear that they are generally not written by documentation experts and, quite often, critical pieces of information are left out. This is common in the StackOverflow environment, but not only... I find, also, that this lack of documentation expertise results in a failure to identify the audience and, therefore, can fail to address the needs of all users, from beginner to expert. An expert can skip the bits they already know, but a new user needs to see all of it, and see it in context: so often a solution is presented but you have no idea of the html it is working with...

On the other hand, and I would specifically mention the react.org site in this matter, the solutions are overly trivial and unhelpful in resolving issues in a complex application.

I have worked in many environments over the years, starting in 1977 on the IBM System 3. But I have never before worked in an unsupported environment like this one. On that subject, I note that npm have a support email address, but emails to that address go unanswered, except for the polite reply recording the receipt of an issue. The offer of support from npm is somewhat aspirational perhaps... I am still waiting for a solution to prevent my navbar scrolling off the screen after attempt to implement npm's solution.

I have been trying to resolve my current reactJS issue for the best part of a week. I only want to change the style of a DIV when it is clicked - you would not think it could be so hard, and i suspect it is actually simple enough provided you can find that corner of the opensource universe in which the solution is hiding...

But, after various strategies and proffered solutions, I remain unable to proceed with the development of my app. My navbar still scrolls off the screen and I cannot change the div style when it is clicked. I am miserable about my lack of progress!

In relation to the div-changing issue, I suspect part of the issue is that what happens underneath reactJS is invisible to the programmer (until you get huge error messages which mean nothing to the reactJS user). In fact, it is not always clear what a reactJS item actually is. For instance, I assumed (having done a lot of work in the object-oriented code world, that the CSS Properties item was an object, which would allow one style collection to copy another style collection:

tileStyle1 : CSS.Properties = { {/* clicked style */}
backgroundColor: 'blue',
fontFamily: 'londrinaBlackRegular',
color: 'yellow'};

but tileStyle = tyleStyle1 produces an enormous error message, all gobbledegook to me, though I get that you cannot copy a set of styles from one of these non-objects to another. A shame.

I also want to ask you why you publish all that guff in the error messages. Sure, if you are working on the compiler and want to see all the underlying javascript stuff when things go wrong, I can understand it might be useful. But what makes you think a reactJS developer wants to see all that, and how would it help them anyway?

In trying to resolve this div issue, I discovered t is also not possible to include a ternary operator in the DIV code -though one might assume it should. I tried several ways but all failed for one reason or another. The followimg suggestion from StackOverlow fails also - producing the error: "unexpected token" at the first of the === characters. Again, a shame, as it would have been a neat solution. Obviously he didn't test the code before he posted it. :-(

Support

You can find the original question with the code at https://stackoverflow.com/questions/62258489/reactjs-hooks-asx-changing-the-style-parameters-for-a-div-when-it-is-clicked/62258647#62258647

I would appreciate a solution to this issue, if there is one; an up-to-date, comprehensive, manual ought to be on your Todo list; and perhaps you could offer a more predictable avenue for obtaining support?

Best regards
Sunbeam Rapier

Sydney

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

此 issue 沒有指出需要修改的檔案、測試或特定文件頁面。請先檢視 react.dev 的文件問題以及連結的 Stack Overflow 問題;在能夠判定何時算是「done」之前,需要明確的範圍和驗收標準。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, react
領域
documentation
Issue 類型
文件
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
15/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。