Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
larsbuch opened this issue Jan 8, 2019 · 0 comments
Open

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

larsbuch opened this issue Jan 8, 2019 · 0 comments

Comments

@larsbuch
Copy link

larsbuch commented Jan 8, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant