Coder Social home page Coder Social logo

Comments (9)

ctxhou avatar ctxhou commented on June 6, 2024 1

That's a good point.
The reason why react-tabtab is designed with re-mount mechanism is hoped to handle as many tabs as possible. If it keeps all the panel mounted result, it will cause performance issue.

But yes, I think that's a possible situation when creating tab UI. Maybe it's possible to add a cache props on the tab, it means this panel won't be unmounted. (Of course, it means developers need to handle the performance issue by themselves.

The possible api:

<Tabs>
  <TabList>
    <Tab>Tab1</Tab>
    <Tab cached>Tab2</Tab> // this tab wont be unmount
  </TabList>
  <PanelList>
    <Panel>
      Accusamus enim nisi itaque voluptas nesciunt repudiandae velit. <br/>
      Ad molestiae magni quidem saepe et quia voluptatibus minima. <br/>
      Omnis autem distinctio tempore. Qui omnis eum illum adipisci ab.
    </Panel>
    <Panel>
      Officiis commodi facilis optio eum aliquam.<br/>
      Tempore libero sit est architecto voluptate. Harum dolor modi deleniti animi qui similique facilis. Sit delectus voluptatem praesentium recusandae neque quo quod.
    </Panel>
  </PanelList>
</Tabs>

What do you think?

from react-tabtab.

ctxhou avatar ctxhou commented on June 6, 2024 1

Hi @dineshnamburi, I will try to add this feature in recent. Maybe next month.
If you have any idea of this feature, any help and PR is welcome.

from react-tabtab.

aichaoxy avatar aichaoxy commented on June 6, 2024

Yeah, I think it's a great solution when the effects of the performance issue are limited.

Some tabs with heavy component and lots of middle states can be set with cache prop, and other tabs can be set without the prop.

from react-tabtab.

aichaoxy avatar aichaoxy commented on June 6, 2024

About how to handle performance issues, I think it deserves detailed discussion.
Many small but useful usage tips can be brought out.

from react-tabtab.

dineshnamburi avatar dineshnamburi commented on June 6, 2024

Hi @ctxhou , is there any plan to add a feature like cached prop to this module, in near future???

from react-tabtab.

qqdaiyu55 avatar qqdaiyu55 commented on June 6, 2024

@ctxhou Any plan on implementing the feature? Thanks.

from react-tabtab.

ctxhou avatar ctxhou commented on June 6, 2024

Hi @qqdaiyu55
I am a little busy recently. Are you interested in implementing this issue?

from react-tabtab.

qqdaiyu55 avatar qqdaiyu55 commented on June 6, 2024

@ctxhou Sorry I'm also busy recently, I'll take a look if I have time. If you have any idea on implementing this feature, you can post it here : )

from react-tabtab.

sandipbgt avatar sandipbgt commented on June 6, 2024

Any update on it? or any possible solution or hack for now?

from react-tabtab.

Related Issues (20)

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.