Giter VIP home page Giter VIP logo

axolotl's Introduction

axolotl

Client info should be kept in local .env to keep it secret

client secret: 333853046c94fbc7a879684589f370475146357e client id: 5c3312c7f96f4983b9c7

2 rediredts:

  1. /login/github
  2. github callback url http://localhost:8080/login/user/home

scope https://github.com/login/oauth/authorize? client_id=...& scope=user%20repo_deployment %20user:follow %20user:email %20read:user

const [state, setState] = useState(SomeState);

the two values in the array can be anything they are just variables.
you are deconstructing like you would do with an object.
the first value(state) is the value in state.
the second value(setState) is the function you will call to changeState
the propper way to do this is with a callback inside that takes in
'prevState' where State is the name of your current state value (just state in this example)

TRIVIAL EXAMPLE: 
const [count, setCount] = useState(5);
//increment count
function incrementCount() => {
  setCount(prevCount => prevCount + 1);
  //increments our count in state to 6
}

You can use the useState() hook for each piece of state you want to keep track of. e.g.

const [count, setCount] = useState(5);
const [userId, setUserId] = useState(userId);
const [matches, setMatches] = useState(matches);

One last thing is all instances of useState MUST be called in the same order on every render
this means you cannot use the hook inside of functions or if statements. 
You should also put your useState hooks at the very top of your component.
Putting the setState function inside of conditons is fine, 
you just cant initialize the values in a different order on render.

axolotl's People

Contributors

ausarenglish avatar mjsalvador avatar rcaporino avatar weilancui avatar

Stargazers

 avatar

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.