Giter Site home page Giter Site logo

expense_tracker's Introduction

This is a very basic expense tracker.

The App focus on the basics of react and decoupling of code and creating reusable components.

To run the project

    before running the project you have to:
    npm install
    npm start

    This is the most configurations needed unless I modify the package.json

Why Componets

  • we focus on reusability and separation of concerns.

  • React is formed by HTML, CSS and JavaScript.

  • Passing Props

    • an example of passing props: goalItem = "props" which inside App component and prop inside CourseGoalItem component.
    <App/> ---> <CourseGoalItem text={goalItem}> ---> <li>{props.text}</li>
    
    
  • we look how React creates elements an example:

    We could have:
    
    return (
        <div>
            <h2>let's go</h2>
            <ComponentFunction items={getUsrs}>
        </div>
    )
    
    how it will look when you use React with createElement using React import.
    
    return React.createElement(
        'div',
        {},
        React.createElement('h2', {}, "let's go"),
        React.createElement(ComponentFunction, {items: getUsrs})
        </div>
    )
    

User Interactionn and state

  • in order to use State in React we have a function provided by React which is is useState().
  • Lifting State up, Sometimes, you want the state of two components to always change together. To do it, remove state from both of them, move it to their closest common parent, and then pass it down to them via props.
  • the idea of passing data around parent components.
                                    <APP/>
                              ________|_________
                             |                  |
                        <Expenses/>        <NewExpenses>

- lifting up the state from <NewExpenses/> to the <App/>

expense_tracker's People

Contributors

samofoke avatar

Watchers

 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.