Skip to content

Initial Data is not set (or at least not accessable in props) #87

@larsbuch

Description

@larsbuch

The initial data I set is not accessible in props
This does not work:

const initialData = {
  stableState: 'stableStateA', 
  previousStates: []
}

export default withStateMachine(statechart, initialData)(App);

And neither does this:

const initialData = {
  stableState: 'stableStateA', 
  previousStates: []
}

export default withStateMachine(statechart, {initialData})(App);

Background is making a workaround for the not working history state with use of external state.

I cannot spot an error in my code. It works correctly after initial data has been overwritten via the transition

Test can be run via this:
Code: https://repl.it/@larsbuch/React-Automata-HistoryTesting-InternalState

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