Giter Site home page Giter Site logo

Comments (4)

cluk3 avatar cluk3 commented on June 3, 2024

Hi @deser , yes it is totally possible to have different context menus, even inside the same component. Just call the hook once for every menu and then use the provided binds to bind the logic to different menus. I'll find time to create a codesandbox with a working example later today.

from use-context-menu.

deser avatar deser commented on June 3, 2024

Many thanks!

from use-context-menu.

deser avatar deser commented on June 3, 2024

is it also possible to have a lot of triggers for one menu? Imagine than I have on a page a lot of elements\components with let's say different types. So elements of type a should trigger context menu with items k and c when elements with type b should have context menu with items h and m .

UPD:
Seems I can utilize useContextTrigger with different collect to differentiate element types.

from use-context-menu.

cluk3 avatar cluk3 commented on June 3, 2024

Exactly, you can call useContextTrigger do generate different triggers, each with a custom config

from use-context-menu.

Related Issues (12)

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.