JavaScript Testing Tutorial - part 3: Testing props, mounting functions, and snapshot testing

Author: Marcin WanagoTranslate: Crazy Technology House Original: https://wanago.io/2018/09/10/... Reproduction is strictly prohibited without permission JavaScript Testing Tutorial - part 1: Unit testing with Jest JavaScript testing tutorial - part 2: Introducing Enzyme and testing React components JavaScript Testing Tutorial - part 3: Testin ...

Posted on Sun, 17 Nov 2019 21:14:27 -0500 by ThaSpY

ES6 I use

let and const The project built by webpack directly discards VaR and directly uses let instead of var let instead of var in for loop After variable declaration, it will not change. Please use const Destructuring assignment Concept: first deconstruct and then assign, first find out the data you need from a pile of data, and then assign the dat ...

Posted on Sun, 17 Nov 2019 13:52:48 -0500 by CincoPistolero

Use of react native Baidu map

Use components: react-native-baidu-map Get Baidu map API Address: http://lbsyun.baidu.com, after the console successfully creates the application, you can see the api of the application key. install yarn add react-native-baidu-map Native part Android configuration react-native link react-native-baidu-map Configure the Android manifest.xml fi ...

Posted on Sat, 16 Nov 2019 15:54:04 -0500 by bubblocity

Practice of React Hooks in Global Status Management

It rained three times last night and kept cool all day.- Su Shi in Parrot Sky The results of the practice are published in github at: react-duce From now on, state management has become a standard for front-end projects, and we'll bring in libraries like MobX and Redux to manage the state we apply, whether it's unnecessary or not.But if we loo ...

Posted on Sat, 16 Nov 2019 03:11:58 -0500 by alco19357

react leaves the page, customize the pop-up blocker, route blocker

Preface:There is a requirement for the project: jump route. Before leaving the page, you need to pop-up the box to ask whether the user is sure to leave.It is possible to use the < prompt > component of react router, but how to use the antd component (or custom component)?Please look at the following. First look at this: https://stackove ...

Posted on Fri, 15 Nov 2019 13:51:20 -0500 by dan7474

The experiment of double buffering mode in the game

Let's suppose A game has three actors (A, B, c) on the stage. Each actor has an actor facing himself and forms A ring (A facing B, B facing C, C facing A). We can slap an actor in the face. No matter who slaps him, he will slap the actor he is facing (so as long as we slap anyone, they will always fan down in A ring). First, write the actors: ...

Posted on Fri, 15 Nov 2019 05:51:04 -0500 by simcoweb

[Front-end beginners can also do big projects]: Build your own online Visio project from scratch [ReactJS + UmiJS + DvaJS]

This series of tutorials teaches you how to use the Open Source js Drawing Library To create your own online drawing software.You can also look at the development tutorial for this drawing library.If you feel good, please give us a compliment and let us be more motivated to do it! This series of tutorials focuses on how to develop your own draw ...

Posted on Thu, 14 Nov 2019 21:10:01 -0500 by kpetsche20

Building high performance forms quickly -- JSXForm

background Form problems, whether in jQuery era or Angular/React era, are always the pain of front-end engineers, but this is impossible. There are various business requirements. For the middle and back-end business, form pages and report pages are basically the core forms of the middle and back-end business. However, React forms are really com ...

Posted on Wed, 13 Nov 2019 09:58:24 -0500 by Master Zen

Summary of Front End Knowledge Points--Introduction to ES6

1.var,let,const ES6 recommends using let to define variables in functionsconst is used to declare a constant (values like values cannot be changed, reference type addresses cannot be changed)let and const are valid only in the last block (in curly brackets) //1.let cannot be repeated var n = 10; var n = 100; console.log(n) //100 let a=10 l ...

Posted on Tue, 12 Nov 2019 20:22:10 -0500 by programguru

react higher level components

react Higher order functions may be a little strange to you. Let's separate higher order functions from functions and see what is higher order first and then what is component. Higher order function Can effectively reduce complexity and component volume Easy to read and understand Reduce bug opportunities In functional prog ...

Posted on Tue, 12 Nov 2019 13:35:37 -0500 by jqa