40 line program integrates the response of Vue3 into React for state management

This article refers to the original- http://bjbsair.com/2020-03-22/tech-info/2095/ Preface Vue next is the source warehouse of vue3. Vue3 uses lerna to divide the package, while the responsive capability @ vue/reactivity is divided into a separate package. If we want to integrate it into React, is it feasible? Let's have a try. Use example If ...

Posted by double on Tue, 24 Mar 2020 01:02:28 -0700

React Hook + TS shopping cart practice (performance optimization, closure trap, custom hook) - Zhihu

Preface This article is based on a basic shopping cart demand, step by step, to give you a deep understanding of the pit and Optimization in React Hook You can learn from this article: A kind of Practice of writing business components with React Hook + TypeScript A kind of How to use React.memo to optimize performance A kind of ...

Posted by Karamja on Fri, 20 Mar 2020 13:28:36 -0700

TypeScript basic operation, configuration file tsconfig.json details, vscode and HBuilderX basic configuration

Node basic command npm installation dependency [npm install xxx] using npm to install xxx depends on the directory where the current command line is located [npm install xxx -g] use npm to install global dependency xxx [npm install xxx – save] install and write to "dependencies" of pac ...

Posted by techevan on Tue, 25 Feb 2020 01:21:36 -0800

Tomato alarm one (the framework of react antd typescript)

1, Main documents React React Router Ant design TypeScript Redux 2, Start using and experience react scaffold npx create-react-app react-app-demo cd react-app-demo yarn start 3, Follow the document Rendering an element ReactDOM.render(<h1>Hello, world!</h1>, document.getElementById('root')); Use of rendering JSX const name = ...

Posted by Niruth on Wed, 12 Feb 2020 08:44:27 -0800

TypeScript design of tool type

TypeScript design of tool type Article directory TypeScript design of tool type Preparatory knowledge Try to solve an interview question Tool type analysis and design considerations How to write training tools? Preparatory knowledge TypeScript advanced type Partial TypeScript advanced type ...

Posted by Azarath on Sun, 02 Feb 2020 22:10:10 -0800

Based on react, react hooks, redux, ts handwritten ant design pro, with supporting api of node, eggjs, ts, mysql, redis

introduce At the beginning, I needed an amdin template developed by react. After finding one side in the open source community, I compared the UI of Ant Design Pro. When I pulled down the code of Ant Design Pro for research, I found that there were too many contents. Besides react and redux, there wer ...

Posted by Spikey on Wed, 29 Jan 2020 02:22:14 -0800

Use.apply() with the'new'operator.Is this possible?

In JavaScript, I want to create an object instance (via the new operator), but pass any number of parameters to the constructor.Is this possible? What I want to do is (but the code below doesn't work): function Something(){ // init stuff } function createSomething(){ return new Something.apply(null, arguments); } var s = createSom ...

Posted by tryingtolearn on Sun, 26 Jan 2020 17:57:58 -0800

Basic introduction module of TypeScript (2)

Reprint Basic introduction module of TypeScript (2) Generate module code According to the module target specified during compilation, the compiler will generate appropriate code for Node.js (CommonJS), require.js (AMD), UMD, SystemJS or ECMAScript 2015 native module (ES6) module loading system. For more information about the define, require, ...

Posted by coffeehead on Sat, 21 Dec 2019 12:44:41 -0800

Hand tear source code series - functor + observer mode + status = Promise

Preface Some time ago, I was too busy to write a blog for nearly a month, but Promise had summed up a wave of how to realize it long ago, but at that time, it was purely for the purpose of realization, without elaborating some of the clever designs. Until recently, when I was learning the knowledge related to functional programming, I found tha ...

Posted by Nightseer on Sun, 15 Dec 2019 12:17:47 -0800

Data flow scheme of transforming old project with dva

Preface Recently, I had some trouble transferring my scaffolding project to TypeScript. Before the project, the system of react + react Redux + Redux thunk + Redux actions + Redux promise was adopted. When a project is converted to TypeScript, react and react Redux are perfect conversions. Redux actions transformation is also initially complete ...

Posted by TonyB on Fri, 13 Dec 2019 04:46:57 -0800