Skip to content

[Basic] Add example of passing a setState dispatch action to basic prop types #574

Closed
@WillowP

Description

@WillowP

What cheatsheet is this about? (if applicable)

Basic cheatsheet

What's your issue or idea?

I think it's very common to pass state setters as props, but the type of that function is not obvious.

I suggest adding an entry to basic/getting-started/basic_type_example#basic-prop-types-examples for useState dispatch action.

Example:

setState: React.Dispatch<React.SetStateAction<someType>> // the dispatch action returned by `useState`

Metadata

Metadata

Assignees

Labels

BASICBasic Cheatsheet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions