Comments (14)
The integrated example stopped working after upgrading to React 16.0.
It breaks when clicking on the (more) link with this error:
Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node
from react-truncate.
Hey guys, thank you very much for reporting.
I haven't been active in this repo for a good amount of time, but I guess some maintenance is needed now and I don't want to be a roadblock here.
I'll look to devote some time now to fix the issues and highly appreciate code contributions.
from react-truncate.
I'm currently working on a fork and will give some pull requests, but a lot of the testing stuff is out of date and updating them is taking longer than I thought.
from react-truncate.
Without the above changes, with react 16 you will always get the following in the console:
warning "[email protected]" has incorrect peer dependency "react@<= 15.x.x".
from react-truncate.
(I'll be making a fork and then pull request soon)
For me two things needed fixing for react 16. The issue I brought up here: #62
And wrapping the text on this line in a span tag: https://github.com/One-com/react-truncate/blob/master/src/Truncate.js#L319
from react-truncate.
PR here #64
from react-truncate.
Updated the playground with react@16
and [email protected]
.
from react-truncate.
Thanks a lot to everyone involved!
from react-truncate.
@pablosichert you need to update peer dependencies:
https://github.com/One-com/react-truncate/blob/master/package.json#L34
from react-truncate.
Looks like you removed it when it got squashed:
https://github.com/One-com/react-truncate/pull/65/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R35
vs
https://github.com/One-com/react-truncate/pull/64/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R35
from react-truncate.
Made a PR: https://github.com/One-com/react-truncate/pull/66/files
from react-truncate.
Hi @jonricaurte thanks for following up. I intentionally reverted the version bump after reading #64 (comment).
react-truncate
is supposed to still work with [email protected]
. For that reason react-truncate
didn't get a major version bump.
Did I miss something?
from react-truncate.
@pablosichert now it should work for both:
https://github.com/One-com/react-truncate/pull/66/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2
An example of another repo using this:
https://github.com/eiriklv/react-masonry-component/blob/master/package.json#L39
from react-truncate.
@jonricaurte I'm sorry, lol. I read that as >=
instead of <=
. You're absolutely right.
from react-truncate.
Related Issues (20)
- <br> tags being added to truncated lines HOT 8
- 3rd party device recognition is blocking usage
- Maintenance status? HOT 2
- ellipsis still display when text isn't too long HOT 1
- ComponentWillUnmount ellipsis removal fails in test suites and other situations HOT 5
- Cannot set property 'font' of undefined HOT 3
- In jest tests - the ellipsis always show, regardless of whether it truncates. HOT 1
- Ellipsis not shown when text is only one word
- Truncate get error on 'width' prop when my app still work in another tab like keep-alive component
- Wrong lines calculation when width specified and having responsive container HOT 3
- React v17 support HOT 2
- Last line length changes when parent component set to display none
- Jest: Can not test onTruncate method HOT 3
- Update to React 17 HOT 5
- deleted
- wrong width of span on load HOT 2
- New release HOT 1
- React 18 support HOT 1
- Can't add as dependency in React 18 HOT 10
- Wrong line breaks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-truncate.