Coder Social home page Coder Social logo

chrisnajman / meme-generator Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 225 KB

Built from Scrimba's 'Build a meme generator' tutorials. Dynamically add text to the top and bottom of the image. Click the button to generate a new image.

Home Page: https://chrisnajman.github.io/meme-generator/

License: MIT License

JavaScript 82.59% HTML 6.95% CSS 10.46%
useeffect-hook api async-await controlled-components css-nesting form-elements github-pages-website html-css-javascript props reactjs

meme-generator's Introduction

React Meme Generator

  • Input text to the 'Top text' and 'Bottom text' inputs to generate text above and below the image.
  • Click the button to generate a new image.

Note

No data is saved.


Scrimba Course Link

Note

(Free) subscription and login required to follow the course.


useEffect()

What is a "side effect" in React? What are some examples?

  • Any code that affects an outside system, e.g.
  • local storage, API, websockets, two states to keep in sync.

What is NOT a "side effect" in React? Examples?

Anything that React is in charge of, e.g.

  • Maintaining state,
  • keeping the UI in sync with the data,
  • rendering DOM elements.

When does React run the useEffect function?

  • As soon as the component loads (first render).
  • On every re-render of the component (assuming no dependencies array).

When does it NOT run the useEffect function?

  • when the values of the dependencies in the array stay the same between renders.

What is the "dependencies array"?

  • Second parameter to the useEffect function.
  • A way for React to know whether it should re-run the effect function.

Testing

Tested on Windows 10 with:

  • Chrome
  • Firefox
  • Microsoft Edge

Page tested in both browser and device views.

meme-generator's People

Contributors

chrisnajman avatar dependabot[bot] avatar

Stargazers

 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.