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

Does not work with expo #1

Open
prameetc opened this issue Apr 21, 2020 · 17 comments
Open

Does not work with expo #1

prameetc opened this issue Apr 21, 2020 · 17 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@prameetc
Copy link

prameetc commented Apr 21, 2020

Simulator Screen Shot - iPhone 8 Plus - 2020-04-21 at 12 57 55

I tried to use the example project code in my project and not able to see the "See More" and "See Less" option, am I doing something wrong?

@fliklab
Copy link

fliklab commented Apr 29, 2020

I am using this plugin in two RN projects. It works fine in one app. But it doesn't work well in another app as your screenshot. Both codes are almost identical and I can't find the reason why it dosen' t work. The difference is the react-native version. The working project is version 0.62, what doesn't work is 0.61.5.

(edited) I've seen it work well a while ago, but now I'm seeing that both aren't working correctly.

@1ike
Copy link

1ike commented Jun 21, 2020

Cuz dependency react-native-text-size does not work as I understood. I think we can forget about these packages. :(

@kashishgrover
Copy link
Owner

Hey guys, I’ve been pretty busy over the past couple of months. I will release an update for this very soon, and update the docs with my latest findings as well. Apologies for the delay

@kashishgrover kashishgrover added the bug Something isn't working label Jun 27, 2020
@kashishgrover kashishgrover self-assigned this Jun 27, 2020
@kashishgrover
Copy link
Owner

@prameetc @fliklab @1ike I just pushed v1.2.0 to npm. Can you folks try it out and give feedback? I'll keep this issue open till we solve this for good. Thanks!

@kashishgrover kashishgrover added the help wanted Extra attention is needed label Jun 27, 2020
@1ike
Copy link

1ike commented Jun 28, 2020

Still have the error "Cannot read property 'measure' of undefined". It was predictable cuz "react-native-text-size" still in use.
"react-native-text-size" may be has problem with Expo (Expo 36 in my case).

@kashishgrover
Copy link
Owner

@1ike In my knowledge, there is no package like react-native-text-size that can work for expo. Since that package links natively, it won't work with an expo managed workflow. You will have to eject the project or use a barebones react native project for that.
To calculate the width of a text, we need to use this package. If you find any alternative which will help us get rid of this dependency, do suggest. All we need to do here is accurately calculate the width of the text.

@1ike
Copy link

1ike commented Jun 28, 2020

It will be usefull to write in Readme about this.

@kashishgrover
Copy link
Owner

You're right, I'll do that. Thanks!

@kashishgrover kashishgrover changed the title See more and See Less not showing up Does not work with expo Jun 30, 2020
@kashishgrover kashishgrover removed the bug Something isn't working label Jun 30, 2020
@fliklab
Copy link

fliklab commented Jul 1, 2020

Thank you for updates! It is now working well. @kashishgrover

And I found something different from before:
If there is a line break in the text, it works to break the text right there and display 'see more'.
Previously, there was a case where 'see more' was not displayed when there was a line break, so it seems to be an improvement. However, it seems not intended when there is a line-break in a position less than the max-number of lines, 'see more' is displayed from there.

@kashishgrover
Copy link
Owner

@fliklab Thanks for testing it. I’m glad it is better now.
Regarding the line break thing, it was something I added as per my use case in my project. There could be edge cases remaining. Feel free to make another issue on this repo with some screenshots of the text before and after clicking “see more” and we can have a discussion over there.

@mehdinourollah
Copy link

mehdinourollah commented Jan 15, 2021

I'm having this issue ( not showing the Show More and Show less) but in React Native CLI and not expo
"react": "16.13.1", "react-native": "0.63.4", "react-native-text-size": "^4.0.0-rc.1", "react-native-see-more-inline": "^1.3.0",

image
image

@kashishgrover
Copy link
Owner

@mehdinourollah can you verify if the react-native-text-size package got installed correctly? It should have a folder in your project's node_modules folder.

const { width: totalTextWidth } = await reactNativeTextSize.measure({

@mehdinourollah
Copy link

Sorry It's working with react-native-text-size now ...It needed a clean android and starting over to react-native-text-size install it's native modules...Thank you so much for this great plugin bro

@vbylen
Copy link

vbylen commented Feb 18, 2022

Has anybody tried if this library works now with expo dev-client?

@dryprogrammer
Copy link

I'm still getting this error. aMarCruz/react-native-text-size#39 was supposed to fix the native linking

@dryprogrammer
Copy link

https://github.com/benjaminharringtonrose/react-native-text-dimensions/blob/master/react-native.config.js approach also seems to work with react-native.config.js

@dryprogrammer
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants