Skip to content

ReactJS: SimpleToast for MPA

License

Notifications You must be signed in to change notification settings

ottograjeda/t-510-SimpleToast

Repository files navigation

ReactJS: SimpleToast for MPA

"SimpleToast" is sample code of a very basic toast notification component for React.

A toast is aka a snackbar... a temporary notification to the user after some action (such as a
button click). A use case is UI feedback; i.e. show response (like "Item Added") after button
click. This is sample code for an toast component in an MPA.

This repo is for Web built using create-react-app (see docs). It can be used as
starter-kit for the MPA or combined with an SPA monorepo, like SimpleApp for
Mobile use on iOS & Android.

Installation

  • Get the repo
  • From root directory, do yarn
    Required Basic ReactJS knowledge. If repo user needs review, please read this

Run

For web, from the root directory, do

  • node_modules/.bin/webpack -p --progress
  • node_modules/.bin/webpack-dev-server --content-base public/ --config ./webpack.config.js --inline --hot --colors
  • Manually open a browser to localhost:8080 to see webapp

Demo & Animated GIFs

Notes - Development

  • CSS is minimal and MUI
  • ServiceWorker (for PWA) not used
  • Component is statefull ; does not use Redux
  • Assets (css, images, etc.) are copied during build process
  • Custom components for Header & Footer included. Can be refactored as needed

Inspiration