Skip to content

initialize state to empty object when getInitialState is not specified #1851

Closed
@fdecampredon

Description

@fdecampredon

hareth: sometime I feel adding a mixin to all my component with getInitialState() { return {} }
vjeux: hareth: i'm surprised that it's not already the case
hareth: http://jsfiddle.net/F26zB/
vjeux: hareth: can you see if there's already a github issue opened for it/create one? I'm curious to see what other people have to say about this

It would avoid to force:

getInitialState: function () { return {} }

wen we need a state object, but do not need to initialize the content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions