react-albus icon indicating copy to clipboard operation
react-albus copied to clipboard

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

Open wzard opened this issue 6 years ago • 9 comments

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 prop step.idis marked as required inSteps, but its value is null. 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?

wzard avatar Sep 13 '18 09:09 wzard

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.

jackjocross avatar Sep 21 '18 16:09 jackjocross

Great. Thanks !

wzard avatar Sep 21 '18 18:09 wzard

Any update on this one @crosscompile ?

AntonKL avatar Feb 13 '19 13:02 AntonKL

@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

dugasmark avatar Mar 21 '19 07:03 dugasmark

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

romarioraffington avatar Oct 09 '19 16:10 romarioraffington

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] avatar Apr 08 '20 00:04 github-actions[bot]

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

github-actions[bot] avatar May 09 '20 00:05 github-actions[bot]

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

github-actions[bot] avatar Sep 10 '20 00:09 github-actions[bot]

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

github-actions[bot] avatar Aug 05 '23 00:08 github-actions[bot]