Recoil: [Documentation]: Minor error in the documentation

Created on 14 Nov 2020  路  2Comments  路  Source: facebookexperimental/Recoil

Hello,
I'd like just to report a minor error in the documentation at this page:
As you can see on the screenshot, on the TodoItemCreator component we should have:
const [,setTodoList] = useRecoilState(todoListState);
instead of
const setTodoList = useRecoilState(todoListState);

I know it's obvious for most of us, but beginners might go crazy with that.

Screenshot 2020-11-14 at 18 33 34

Thanks.

documentation invalid

Most helpful comment

@nickmarca Look closer: this code sample uses useSetRecoilState, not useRecoilState, so it looks correct to me.

All 2 comments

@nickmarca Look closer: this code sample uses useSetRecoilState, not useRecoilState, so it looks correct to me.

@nickmarca - An important reason one might use useSetRecoilState() instead of useRecoilState() is if you want to avoid a component subscribing to re-render when the value is changed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eLeontev picture eLeontev  路  3Comments

aappddeevv picture aappddeevv  路  3Comments

ymolists picture ymolists  路  3Comments

pesterhazy picture pesterhazy  路  4Comments

jamiebuilds picture jamiebuilds  路  3Comments