jcmcneal / react-step-wizard

A modern flexible step wizard component built for React.
MIT License
583 stars 126 forks source link

[FR] Provide hashkeys or another prop specified on child as array to Nav component #39

Open akshitkrnagpal opened 5 years ago

akshitkrnagpal commented 5 years ago

My use case is that I want to display a title for each step in the navbar. My current solution is to create a new array and render navbar items by mapping it. It would be nice if Nav component can get just the hashkeys of all children rendered in StepWizard component. It can also be some other prop if not hashKeys.

Something like this would be helpful in my case.

<StepWizard nav={<Nav />}>
   <StepA hashKey='A' />
   <StepB hashKey='B' />
   <StepC hashKey='C' />
</StepWizard>
const Nav = ({ hashKeys }) => {
   console.log(hashKeys);
   //  => ['A', 'B', 'C']
}

It would be great if, I can just map an array prop to display my navbar items.