-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
How to preserve ListItem styling when upgrading to v1? #1565
Comments
Solved by creating ListItem and ListContainer files to map to legacy ListItem and List, with styles. Files below. I would strongly suggest having a clear upgrade path that will allow users to retain their styles without needing to figure out how to rebuild them like this, if only a note under ListItem in the documentation! The documentation also just appears to be incorrect - it doesn't list any styles in the code, but styles are applied in the screenshots which is why I spent 2-3 hours trying to figure out why I wasn't getting the default styles. Thanks, still love the library. ListContainer.tsx:
ListItem.tsx:
In Styles.ts:
|
Hey @lukewlms thanks for bringing this up. We definitely have to put up some instructions for upgrading from 0.19.1 to v1 but we having done it as yet. This is cause we still have a few things we want to change before finish development. Be sure this is definite walkthrough we will publish on release of v1 |
We released a migration guide on the release of v1.0.0 https://react-native-training.github.io/react-native-elements/blog/2019/01/27/1.0-release.html |
@iRoachie Would still strongly recommend putting up a style example so those migrating can achieve parity with their old look! I don't see it in the guide, though looks great otherwise. Otherwise each implementer will have to reinvent the wheel and reverse-engineer or dig for this style in the old code so app appearance doesn't change. Per |
Are there any particular examples of usage you’d like to see? |
@iRoachie Just parity with previously existing view styles, per https://github.com/react-native-training/react-native-elements/issues/1565#issuecomment-436982251. |
Can you be a bit more specific about which props/styles you were using in 0.19.1? It's a bit hard to get all props to work exactly the same in v1.0.0 as some props were removed as well. The more info you can give about how you were using it(props, styles) then I can try to implement the same styling in v1. |
@iRoachie I didn't implement anything new and wasn't using any styles in 0.19.1 - the thing is that developers must now start using styles for lists and list items, which was not necessary pre-v1.0. The styles above are identical to the default styles in 0.x that were removed. Adding the styles above to a v1.0 app will ensure the lists and listitems look the same as they did before upgrading to v1.0 so adding them is necessary for developers who are upgrading. They can be copied in by developers as-is above b/c they're pulled directly from the old (now removed) built-in RN Elements styles. |
Ahhh i understand you now. Can you make a PR to make a note (link your comment) in the blog post? |
Sure thing, created https://github.com/react-native-training/react-native-elements/pull/1777 |
I was wondering why on earth the ListItem was not styled. Man, those were hours of searching for this and I couldn't find a single mention on the docs about this. I think we should let users aware that the screenshots DOES NOT represents the sample codes. |
This seems like an important change to me because the writing here doesn't match the images. Adding the example code will _not_ produce the pictured results, because there is no styling in the example code. The code in this comment does produce nice results. See one frustrated user here: https://github.com/react-native-training/react-native-elements/issues/1565#issuecomment-499344338 - we also hit this issue and spent probably a couple hours trying to figure out why styling had died after an upgrade. I believe this issue will be a significant hurdle for new users, and hurts the initial experience quite a lot. It's just not possible to use ListItems without styling (they will look terrible) and this is a library that usually provides at least reasonable styling right away, so at minimum an example seems called for. This PR is one way to do it, ofc more docs could be written as well. Thanks for considering - we use this lib heavily and want it to be a success!
@lukewlms Thank you so much for the time you've taken into this, I really appreciate the attention given. ❤️ |
After upgrading to v1, ListItem styling has disappeared in our app. It appears this is intended (the styling from
<List>
is removed).To make the upgrade path much cleaner, can you give us a simple way to reproduce the style we used to get from List? We don't want our app to change so it should be identical, but reverse engineering it will be pretty annoying (and would have to be repeated by anyone doing the upgrade).
Thanks!
The text was updated successfully, but these errors were encountered: