Warning: Cannot update a component (`xxx`) while rendering a different component (`xxx`).
A warning is occured where useRecoilValue() is used even though I write a code like one which is in the [official document here](https://recoiljs.org/docs/introduction/getting-started/#selector). <img width="516" alt="スクリーンショット 2020-05-15 4 55 26" src="https://user-images.githubusercontent.com/37825725/81980341-61841500-9669-11ea-9427-390d04645eca.png"> this is my code ``` import React, { useEffect } from 'react'; import { atom, useRecoilState, useRecoilValue, selector } from 'recoil'; function RecoilApp() { useEffect(() => { console.log('test'); }); return( <div> Recoil App <TextInput /> <CharCount /> </div> ); } const textState = atom({key: 'textState', default: ''}); function TextInput() { const [text, setText] = useRecoilState(textState); const onChange = event => { setText(event.target.value); } return( <div> <input type="text" value={text} onChange={onChange} /> <br /> Echo: {text} </div> ); }; function CharCount() { const count = useRecoilValue(countState); return <>Charset Count: {count}</>; } const countState = selector({ key: 'countState', get: ({get}) => { const text = get(textState); return text.length; }, }); export default RecoilApp; ```
Posted by syunto07ka on May 14, 2020, 8:10 PM
Tags
Related issues
- 2026 - Microsoft Office 365
- [Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
- Gamut mapping
- [Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
- [Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
- [BUG]: infinite loading of videos
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (SaaS)
2026 - Microsoft Office 365
[Ubuntu] `ubuntu-latest` label will use Ubuntu 26.04 in November 2026
Gamut mapping
[Codex Desktop] Editing and resending a queued message triggers "App-server queued follow-up no longer exists"
[Windows] ChatGPT 26.820.60940 fails with "invalid transport in mcp_servers.codex_app"; Beta 26.727.40816 works
[BUG]: infinite loading of videos
Restore GPT-5.6 Sol’s 372k Codex context window, or provide an opt-in setting
Codex Desktop for macOS repeatedly triggers `syspolicyd` / `trustd` CPU and memory runaway
Warning: Cannot update a component (`xxx`) while rendering a different component (`xxx`).
A warning is occured where useRecoilValue() is used even though I write a code like one which is in the [official document here](https://recoiljs.org/docs/introduction/getting-started/#selector). <img width="516" alt="スクリーンショット 2020-05-15 4 55 26" src="https://user-images.githubusercontent.com/37825725/81980341-61841500-9669-11ea-9427-390d04645eca.png"> this is my code ``` import React, { useEffect } from 'react'; import { atom, useRecoilState, useRecoilValue, selector } from 'recoil'; function RecoilApp() { useEffect(() => { console.log('test'); }); return( <div> Recoil App <TextInput /> <CharCount /> </div> ); } const textState = atom({key: 'textState', default: ''}); function TextInput() { const [text, setText] = useRecoilState(textState); const onChange = event => { setText(event.target.value); } return( <div> <input type="text" value={text} onChange={onChange} /> <br /> Echo: {text} </div> ); }; function CharCount() { const count = useRecoilValue(countState); return <>Charset Count: {count}</>; } const countState = selector({ key: 'countState', get: ({get}) => { const text = get(textState); return text.length; }, }); export default RecoilApp; ```
Comments (0)
No comments yet. Start the discussion.