chenquincy / react-ellipsis Goto Github PK
View Code? Open in Web Editor NEWA high performance and customized ellipsis component for react, support rich text. 高性能、高度自定义、支持富文本的 react 缩略组件。
License: MIT License
A high performance and customized ellipsis component for react, support rich text. 高性能、高度自定义、支持富文本的 react 缩略组件。
License: MIT License
Hi, thank you for this great library.
When integrating react-ellipsis with a Nextjs project, I see this issue in the server log:
Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.
Could you fix it using something like useisomorphiclayouteffect
. Thank you.
我有一些定制的需求需要调整 Ellipsis Node 的位置,这个必须在完成 ellipsis 运算之后才能做
antd的select里使用要把display:-webkit-box给disabled掉才能截断,不知道什么原因
Set ellipsis
to false
then true
and resize the frame.
https://codesandbox.io/s/ancient-darkness-c9xfc?file=/src/App.tsx
react-ellipsis/src/utils/is.ts
Line 11 in f820a39
在我的项目初始化时,由于一些特殊的操作,document.body会为null。
If text property is a string that is less than maxLine, the ellipsisNode still shows. The maxLine prop should be static in my useCase but the text is dynamic.
Image attached
<Ellipsis
text='My short text'
ellipsis={ellipsisState}
maxLine={3}
reflowOnResize
onEllipsisClick={toggleReadMore}
ellipsisNode={<strong> ...{ellipsisState ? t('readMore') : t('readLess')}</strong>}
endExcludes={[' ', ',', '.']}
/>
可支持IE吗
产品提了个需求,要求超过 5 行折叠成 3 行,这个好弄么
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.