[Suggestion]: Add a note about the `use` API as an alternative to `useEffect`
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 11.8k
- Forks
- 7.9k
- Merge médio
- 1d 11h
- PRs com merge (30d)
- 11
Descrição
Summary
The section on the useEffect page about good alternative to fetching data is a great resource, but does not mention the use API at all. I recommend adding some text to clarify the existence of this option and any pros/cons.
Page
https://react.dev/reference/react/useEffect#what-are-good-alternatives-to-data-fetching-in-effects
Details
It is unclear from the documentation what the relationship between useEffect and use is. The useEffect page does not mention the use API at all, and neither does the use page. The useEffect page contains a section called “Fetching data with Effects”, and the use page contains a section called Streaming data from the server to the client. So, it sounds like both can be used for fetching data, but there is no acknowledgement of this or relevant guidance.
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece lendo a seção “What are good alternatives to data fetching in Effects?” da página de useEffect e a seção “Streaming data from the server to the client” da página de use. Esclareça a relação entre useEffect e use, incluindo os trade-offs relevantes, e atualize a documentação para que os leitores possam identificar quando cada abordagem se aplica.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript, react
- Domínio
- documentation
- Tipo de issue
- Documentação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 68/100