Skip to content

examples-hub/react-starter-ts-preact

Repository files navigation

react-starter-ts

simple starter boilerplate for react using typescript

overview

  • features
    • 😎️ switch between react(v17) and preact(v10) out of the box
    • simple react starter boilerplate
    • support react/preact hot reloading
    • built with react/preact + typescript + babel + webpack(v5) from scratch
      • pre-configured with code quality tools: eslint, prettier, jest, etc.

  • css-in-js not baked in
    • css is using scss/css
  • no state management library baked in
    • hooks are enough for simple apps
  • no routing baked in
  • codebase structure is unopinionated
    • the starter app is very simple with little code
    • no third party react component library baked in

🤗️ if you want to start with a batteries-included react app, you can have a look at my project prospect-garden-dashboard(WIP)

usage

npm i

# start react app
npm run start

# start preact app
npm run start2

notes

  • only a few scripts in package.json work; just write your own
  • if the app is started with preact env
    • .tsx/.scss hot reloading is supported
    • Preact Devtools is supported; but you need to install the preact browser extension first
  • ❌️ component testing is using @testing-library/react ; preact is not supported
    • it's not easy to switch from @testing-library/react to @testing-library/preact or jest-preset-preact with little effort because you need to change the config and/or the apis
    • if you want to test with preact, write with your own choice
    • jest-preset-preact env is ready for npm run test:preact to help you start quickly

About

quickstart boilerplate for react using typescript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published