bug: `Channel` remounts its `children` when changing channels
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia individuando il componente Channel e l’utilizzo di setActiveChannel descritto nella riproduzione. Riproduci il cambio di canale con un componente figlio che registri il proprio mounting, quindi traccia il motivo per cui il figlio viene montato nuovamente e aggiungi una copertura per il cambio di canale. Il lavoro è completato quando i figli rimangono montati al cambio del canale attivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Any children inside of Channel get remounted when switching channels
To Reproduce
Steps to reproduce the behavior:
- Include any component inside of
Channel:<Channel><Component /></Channel> - Switch to another active channel (via
setActiveChannel - Notice inner component remounts
Expected behavior
Children of Channel do not remount.
Example repro code
const Component = () => {
useState(() => {
console.log("Component mount");
});
return null;
}
// stream client and channelId (string) passed in
const Example = ({ channelId, streamClient }) => {
const { setActiveChannel } = useChatContext();
useEffect(() => {
if (!streamClient) return;
const channel = streamClient.channel("messaging", channelId);
setActiveChannel(channel);
}, [streamClient, setActiveChannel, channelId]);
return (
<Channel>
<Component />
</Channel>
);
};
Package version
- stream-chat-react: 13.14.4
- stream-chat-css:
- stream-chat-js: 9.38.0
Desktop (please complete the following information):
- OS: MacOS
- Browser: Chrome and Safari
- Lingua principale
- TypeScript
- Stelle
- 844
- Fork
- 299
- Merge medio
- 1g 16h
- PR unite (30g)
- 14
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GetStream/stream-chat-react
-
bug: attachment upload notifications are shown again in other channels after switching channel Apertabug status:confirmed
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
GetStream/stream-chat-react#3279 · 3 commenti ·
-
bug status: unconfirmed
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
GetStream/stream-chat-react#2863 · 4 commenti ·
-
bug status:confirmed
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
GetStream/stream-chat-react#2652 · 2 commenti ·
-
bug status: unconfirmed
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
GetStream/stream-chat-react#2647 · 2 commenti ·
-
dependencies
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
GetStream/stream-chat-react#1982 · 8 commenti · 1 reazione ·
Tutte le issue di GetStream/stream-chat-react
Issue simili
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Crush Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
ElementsProject/cln-application#167 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Quantco/pnpm-licenses#17 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100