Code Monkey home page Code Monkey logo

Comments (15)

costinEEST avatar costinEEST commented on July 20, 2024 1

Mail.js is now rewritten using hooks, #24

from genesia.

Remeic avatar Remeic commented on July 20, 2024 1

My proposal in #29 , what do you think? @adeelibr @ccampean

from genesia.

Remeic avatar Remeic commented on July 20, 2024 1

@adeelibr Good advice! I consider to implement it on next PR, I can search more services like mailnesia

from genesia.

adeelibr avatar adeelibr commented on July 20, 2024

I am making a PR for this.
Change this file to Hooks only? https://github.com/Remeic/genesia/blob/master/src/Mail.js

Also should this be dumb functional component only https://github.com/Remeic/genesia/blob/master/src/App.js?

from genesia.

Remeic avatar Remeic commented on July 20, 2024

@adeelibr hello! Thanks for contributing, I think you can implement hooks only in mail.js

from genesia.

adeelibr avatar adeelibr commented on July 20, 2024

@ccampean I was about to make a PR when i saw this :D Thank you for the heads up :)

from genesia.

Remeic avatar Remeic commented on July 20, 2024

@adeelibr if you want, send the PR, so we compare them, I also wrote my own version with hooks. we can learn something more

from genesia.

costinEEST avatar costinEEST commented on July 20, 2024

I like the fact that the component is cleaner now.

from genesia.

adeelibr avatar adeelibr commented on July 20, 2024

@Remeic looks good to me.

from genesia.

Remeic avatar Remeic commented on July 20, 2024

@ccampean i see your PR, i prefer don't link suffix with useState, because is immutable string.
Can I know why you chose to use useState? maybe something escapes me.

from genesia.

costinEEST avatar costinEEST commented on July 20, 2024

I missed that variable. It should be outside of state's component.

from genesia.

Remeic avatar Remeic commented on July 20, 2024

@ccampean No problem, I'm here to learn. Thanks again!

from genesia.

adeelibr avatar adeelibr commented on July 20, 2024

I think it should inside the state component, because getComposedMail is used as a function in the state component that takes in 2 params, assuming there can be multiple suffexes for different components, I think it's better if it stays inside the component.

from genesia.

Remeic avatar Remeic commented on July 20, 2024

@adeelibr so you advice to move suffix in the state of component, in case there are multiple suffixes, right?

from genesia.

adeelibr avatar adeelibr commented on July 20, 2024

Yes, & if you want more control over the suffixes just pass a suffix prop down your component, and have defaultProp for suffix = somerandomvalue in case no one passes the suffix prop.

from genesia.

Related Issues (11)

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.