Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

State type inferrence #174

Copy link
Copy link
@shaun-sweet

Description

@shaun-sweet
Issue body actions

Currently the guide has for react components the state type defined up with the props. Instead, I propose its changed to be flipped a bit. For example ->

type ownProps = {}
const initialState = {
  isOpen: false
}

class Modal extends React.Component<ownProps, typeof initialState> {
  state = initialState

this better follows the repositories philosophy of implementation being the source of truth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.