sghall / react-compound-slider

:black_medium_small_square: React Compound Slider | A small React slider with no opinion on markup or styles
https://react-compound-slider.netlify.com
MIT License
626 stars 80 forks source link

Cannot read property 'type' of null error in 3.1.0 #128

Closed artygrand closed 4 years ago

artygrand commented 4 years ago

Problem or feature description:

After I updated dependencies, slider was crushed with TypeError: Cannot read property 'type' of null /Slider/Slider.tsx:40 const type = (item as RCSComponent).type;

Steps to reproduce (for problems):

if withTicks is false

{withTicks && <Ticks count={tickCount}>
                {({ ticks }) => (
                    <div className="ticks">
                        {ticks.map(tick => (
                            <Tick key={tick.id} tick={tick} count={ticks.length} />
                        ))}
                    </div>
                )}
            </Ticks>}

If I render variable with null instead of component, error is also displayed

React-Compound-Slider: 3.1.0 from npm

sghall commented 4 years ago

Thanks for reporting. I'll get a fix out for this. Looks like https://github.com/sghall/react-compound-slider/pull/127

sghall commented 4 years ago

Released version 3.1.1 which should fix this issue. Please let me know if it doesn't.