americanexpress / react-albus

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

Warning that step.id is null when the Wizard is first time rendering. #29

Open wzard opened 6 years ago

wzard commented 6 years ago

Hi,

First of all great library. Does what it says and does it best. I was trying it out and was getting warning. Warning: Failed prop type: The propstep.idis marked as required inSteps, but its value isnull. in Steps (created by Wizard) in Wizard (created by Onboarding)

Turns out the same warning was replicated in the console.log of the official examples from add animation onwards.

Problem: Basically whenever I try to render Step, using Wizard's render api, this warning shows up. The default props of Steps.id = null. When the object is rendering it throws an error.

Can you please check?

jackjocross commented 6 years ago

Thanks!

I think we probably shouldn't mark step.id as required in <Steps> since it is purposely null for the first render.

This shouldn't cause any issues with functionality but I'll try to open a PR soon to get rid of the warning.

wzard commented 6 years ago

Great. Thanks !

AntonKL commented 5 years ago

Any update on this one @crosscompile ?

dugasmark commented 5 years ago

@AntonKL To prevent the warning to pop I contionnaly set the "step" prop like this:

<Steps key={step.id} step={step.id ? step : undefined}>

This way while the step id is null the "step" props is not pass

romarioraffington commented 5 years ago

Seems like a simple fix. @crosscompile why not accept a PR to fix the issue?

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 30 days with no activity. Remove no-issue-activity label or comment or this will be closed in 5 days.

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity.