Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

imduchuyyy/CodeBaseFrontendReactjs

Repository files navigation

Code Base Front-end React, Webpack, Babel, Eslint using with Graphql

Setting:

  1. Connect to Backend
    • Setting in 2 file .env.development.local and .env.production.local
  2. Setting router
    • Setting in src/configs/routers/index.js
  3. Setting Provider
    • Setting in src/utils/provider/index.js

Usage:

  1. Running with command:
    • Start

    npm run start

    • Build

    npm run build

  2. Catching error from backend
import { DecodeError } from '@utils'

try {
  ...
} catch (e => {
  console.log(DecodeError(e))
})
  1. Using alias
    • Đối với các thư mục cấp 0 từ src, vui lòng tạo file index.js để export các component ở trong thư mục cấp 0 đó.
    • Sau khi export các bạn có thể import theo cách sau.
import { ... } from '@components'
import { ... } from '@configs'
import { ... } from '@pages'
import { ... } from '@tools'
import { ... } from '@utils'
  1. Support Dynamic Import
import('@pages/login').then(({ default: Component }) => {
  return <Component />
})
  1. Support i18next
    • Edit file index in folder config/i18n to translate
  2. Support eslint
    • delete src/ in file .eslintignore and add script "prestart": "npm run eslint-fix" into file package.json to use

About

An open source code base for front-end develop

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published