Skip to content

A template for creating new react application using shadow DOMs for isolation from the main document. Alternative to iframes

Notifications You must be signed in to change notification settings

xvargr/react-web-component-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ced4585 · Sep 12, 2023

History

8 Commits
Sep 11, 2023
Sep 12, 2023
Sep 12, 2023
Sep 11, 2023
Sep 11, 2023
Sep 12, 2023
Sep 12, 2023
Sep 12, 2023
Sep 12, 2023
Sep 12, 2023
Sep 12, 2023
Sep 11, 2023
Sep 11, 2023
Sep 11, 2023
Sep 11, 2023
Sep 11, 2023

Repository files navigation

React Web Component Template

This template provides a minimal setup to get React working in Vite as a web component to be injected into existing applications. See injectIndex.html to see how the bundler injects the react script into a target div and stylesheets into the react app shadow dom.


Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

  • Configure the top-level parserOptions property like this:
   parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
    project: ['./tsconfig.json', './tsconfig.node.json'],
    tsconfigRootDir: __dirname,
   },
  • Replace plugin:@typescript-eslint/recommended to plugin:@typescript-eslint/recommended-type-checked or plugin:@typescript-eslint/strict-type-checked
  • Optionally add plugin:@typescript-eslint/stylistic-type-checked
  • Install eslint-plugin-react and add plugin:react/recommended & plugin:react/jsx-runtime to the extends list

About

A template for creating new react application using shadow DOMs for isolation from the main document. Alternative to iframes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published