Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'slice' of undefined #7

Closed
srakshit opened this issue Jul 20, 2016 · 3 comments
Closed

Cannot read property 'slice' of undefined #7

srakshit opened this issue Jul 20, 2016 · 3 comments

Comments

@srakshit
Copy link

srakshit commented Jul 20, 2016

Hi @joshcarr ,

I'm using the minimalist feature of the filter like

<StructuredFilter
    placeholder="Search..."
    options={[
        {category:"Name",type:"text"},
        {category:"Price",type:"number"},
    ]}
/>

and I'm getting the error

Uncaught TypeError: Cannot read property 'slice' of undefined
getStateFromProps 
Tokenizer 
constructComponentWithoutOwner 

Could you please help.

Thanks
Subham

@joshcarr
Copy link
Owner

You must either provide a value or a defaultValue prop. Unfortunately, the docs don't reflect that. But if you look at them you can see how to use one or the other of those props to make the component controlled or uncontrolled:

https://github.com/joshcarr/react-structured-filter/blob/master/docs/index.md

@joshcarr
Copy link
Owner

Fixed this in d484849 and released v4.3.0

@srakshit
Copy link
Author

@joshcarr Thanks! It works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants