americanexpress / react-albus

✨ React component library for building declarative multi-step flows.
Apache License 2.0
1.1k stars 89 forks source link

fix(onNext)!: stop calling onNext in componentDidMount #90

Closed ryhinchey closed 3 years ago

ryhinchey commented 3 years ago

BREAKING_CHANGE: onNext will no longer be called within Wizard's componentDidMount

closes https://github.com/americanexpress/react-albus/issues/33

Description

onNext is called within componentDidMount inside Wizard. This is confusing because no action has been taken at this point and next has not been called yet.

Motivation and Context

onNext being called inside componentDidMount is confusing for developers https://github.com/americanexpress/react-albus/issues/33. Additionally, on initial render, you don't have the steps date or current step id to make a decision about where you might want to go.

How Has This Been Tested?

a unit test was updated to ensure onNext isn't called on render

Types of Changes

Checklist:

What is the Impact to Developers Using react-albus?

if they previously depended on onNext being called on initial render, it won't get called any more.

ryhinchey commented 3 years ago

closing this in favor of the functionality currently on the 3.x branch