Code Monkey home page Code Monkey logo

react-ellipsis's Issues

small initial text

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={[' ', ',', '.']}
/>

image

useLayoutEffect warning when using with Next.js

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.