GithubHelp home page GithubHelp logo

Comments (7)

EmmaDawsonDev avatar EmmaDawsonDev commented on June 3, 2024 1

Sure!

from accessiblewebdev.

ctoffanin avatar ctoffanin commented on June 3, 2024 1

Perfect, so my idea of a hook was on the right path.

from accessiblewebdev.

ctoffanin avatar ctoffanin commented on June 3, 2024

Hi Emma, can I be assigned to this?
I decided to join hacktoberfest. I'll wait till it starts.

from accessiblewebdev.

ctoffanin avatar ctoffanin commented on June 3, 2024

Hi, @EmmaDawsonDev! I'm getting some issues with this one (my skills in React are not so awesome).
I was trying to handle the click from within the Theme Switcher component. The problem is that it "conflicts" with the button onClick (I have difficulties differentiating between the 2).
I was thinking of adding a hook or a new component acting as a listener and wrapping the ul tag with it to handle the click outside.
I see npm packages are doing this thing (i.e. this).
Let me know what your idea/approach on this one is.

from accessiblewebdev.

EmmaDawsonDev avatar EmmaDawsonDev commented on June 3, 2024

No worries, I was also having similar issues which is why I created an issue to do it later :D I think this is probably what we need: https://usehooks-ts.com/react-hook/use-on-click-outside this is what we use at work to achieve the same thing.

from accessiblewebdev.

EmmaDawsonDev avatar EmmaDawsonDev commented on June 3, 2024

You can make a new folder called customHooks and pop it in there.

from accessiblewebdev.

ctoffanin avatar ctoffanin commented on June 3, 2024

This is nice! I have so many stashes saved 😂
Also, instant bookmark of usehooks-ts.com!

from accessiblewebdev.

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.