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

ItemRenderer is not working #429

Closed
pvtran1995 opened this issue Sep 26, 2018 · 6 comments
Closed

ItemRenderer is not working #429

pvtran1995 opened this issue Sep 26, 2018 · 6 comments

Comments

@pvtran1995
Copy link

Describe the bug
I can't use itemRenderer. Original example is not working
https://codesandbox.io/s/04l9x67qxv
Please help me!

Screenshots
image

@gachavez
Copy link

gachavez commented Sep 26, 2018

You have to pass in getItemProps() in div tag like this

itemRenderer = ({ item,getItemProps }) => { return ( <div {...getItemProps()} > <span style={{ fontWeight: 600 }}>Hack:</span> <span style={{ textDecoration: "underline" }}>{item.title}</span> </div> ); };

Also, shouldn't this be posted in stack overflow?

@pvtran1995
Copy link
Author

pvtran1995 commented Sep 26, 2018

You have to pass in getItemProps() in div tag like this

itemRenderer = ({ item,getItemProps }) => { return ( <div {...getItemProps()} > <span style={{ fontWeight: 600 }}>Hack:</span> <span style={{ textDecoration: "underline" }}>{item.title}</span> </div> ); };

Also, shouldn't this be posted in stack overflow?

Thanks for your help.
Author should update div {...getItemProps()} in codesandbox example
image.

Thank you very much.

@Ilaiwi
Copy link
Collaborator

Ilaiwi commented Sep 26, 2018

Yup! I should. I will update it then close this issue to keep track

@acemac
Copy link
Contributor

acemac commented Oct 2, 2018

@Ilaiwi to jump in on this one. The default item renderer seems to have changed behaviour.

Previously, the item's text would be this.itemTitle, now it is this.itemDivTitle

Previously the item's div title (the tooltip) would be this.itemDivTitle, it is now not set.

@Ilaiwi
Copy link
Collaborator

Ilaiwi commented Oct 13, 2018

@acemac yes you are correct my bad. I will keep this open then, but if you would like to create another issue with a codesandbox example that would be appreciated.

@Ilaiwi
Copy link
Collaborator

Ilaiwi commented Nov 16, 2018

released in 0.22.0

@Ilaiwi Ilaiwi closed this as completed Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants