react-albus
react-albus copied to clipboard
Warning that step.id is null when the Wizard is first time rendering.
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 in
Steps, 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?
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.
Great. Thanks !
Any update on this one @crosscompile ?
@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
Seems like a simple fix. @crosscompile why not accept a PR to fix the issue?
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.
This issue is stale because it has been open 30 days with no activity.
This issue is stale because it has been open 30 days with no activity.
This issue is stale because it has been open 30 days with no activity.