joys-react-h5-scripts

Configuration and scripts for Create React App.

Usage no npm install needed!

<script type="module">
  import joysReactH5Scripts from 'https://cdn.skypack.dev/joys-react-h5-scripts';
</script>

README

joys-react-h5-scripts

This package includes scripts and configuration used by Create React App. Please refer to its documentation:

  create-react-app my-app --scripts-version=joys-react-h5-scripts

Then cd my-app, yarn eject, yarn start can start APP normally.

FAQ

Prompt type error at startup

Type error: Argument of type '({ history }: SubscriptionAPI) => Element' is not assignable to parameter
 of type 'Router'.
  Types of parameters '__0' and 'api' are incompatible.
    Type 'RouterAPI | undefined' is not assignable to type 'SubscriptionAPI'.
      Type 'undefined' is not assignable to type 'SubscriptionAPI'.  TS2345

    22 | };
    23 |
  > 24 | app.router(router);
       |            ^
    25 | app.start(document.getElementById('root'));
    26 | registerServiceWorker();
    27 |

After you create the app, you need to execute yarn eject and start the app

this.htmlWebpackPlugin.getHooks is not a function

"html-webpack-plugin": "^4.0.0-beta.2"

Changelog

V0.1.2

  • update readme