Git Product home page Git Product logo

poetlines's Introduction

Poetlines

Todoes

  • - Load the home page on load
  • - Refresh when the related are click and loaded
  • - Make the search bar functional
  • - Register an account, using snapbase
  • - Make the read more btn load the poem.
  • - Don't use the local storage for the load poems
  • - Load more poems when click on Noba of poems
  • - Add pagination to the morePoems page
  • - Add filter for the morePoems page
  • - Three random feature poems on the morePoems page.

Learnt

1. useEffect hook

Used to fire a function each time there is a rerender

useEffect( () => {
  // function body
})
2. dependency array
useEffect( () => {
  // function body
}, [])
  • Fires the function once, when the page renders the first time.
  • A good place to fetch data
const [name, setName] = useState('Mario');
...
useEffect( () => {
  // function body
}, [name])

useEffect() when watch the state name name if there is a change on this state the useEffect function is fired. Thus, this would be fired when the page first renders, and whenever the name state changes.

3. json-server

npm i --location=global json-server npx json-server --watch data/db.json --port 9000

4. Link vs NavLink from react-router-dom

Link does not give the active class to any of its element.

5. "Homepage" field from package.json

The Homepage should be a domain name, not with the path to whatever. If the path after the domain name is specified the server would set the path as a path to the localhost.

That is, if the homepage is something like this

  {
    "name": "poetline",
    "version": "0.1.0",
    "private": true,
    "Homepage": "mulfranck.github.io/poetlines/",
    //...
  }

When npm start is executed the resulting url is

local: https://localhost:3000/poetlines

instead of https://localhost:3000

poetlines's People

Contributors

mulfranck avatar

Watchers

 avatar

Forkers

shalawi237

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.