React writes the input component to share onChange
Before, there was less input on the written page, so no single component was proposed. Today, I studied the input component, but shared an onChange problem card for a while. After checking, I found several better ways to share:
Method 1
Input component
let Input = React.createClass({
getInitialState: function() {
return { } ...
Added by sws on Sat, 07 Dec 2019 17:55:12 +0200
Get started with React 0x014: Fragment
0x001 lead to problems
Let's start with a chestnut:
class App extends React.Component {
render() {
return (
<h1></h1>
<h1></h1>
)
}
}
ReactDom.render(
<App theme='dark'/>,
document.getElementById('app')
)
The render in the chestnut above returns two siblings ...
Added by munuindra on Fri, 06 Dec 2019 06:29:22 +0200
01 maze problem solving (bfs, connecting block)
subject https://www.luogu.org/problemnew/show/P1141
This solution is mainly for my personal problems and attention.
Solving problems
Let's start with the Unicom block
For example, if a fish swims in a pond, then in the case of unlimited time, the small fish will swim across all positions of the pond, which has nothing to do with the starti ...
Added by webtuto on Thu, 05 Dec 2019 04:16:22 +0200
Notes arrangement of React beginner study -- Introduction and syntax of JSX
Let's look at this code first:
import React from 'react';
//In the final rendering, you need to call the react DOM library to render jsx to all pages
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
let h = <React.Fragment>
<h2>hello</h2>
<ul></ul>
</React.Fragment ...
Added by ihcra on Tue, 03 Dec 2019 03:34:20 +0200
Applet development: pull up to load data
Introducer
The requirement is to pull up and load data, which is actually to obtain paging data. The background is the normal ajax request paging data. The small program part is a little more complex. I checked some data, but I couldn't find the link to the data, so I can't put it for reference.
Applet page
When it comes to data loops, here's a ...
Added by sharyn on Sun, 01 Dec 2019 13:45:43 +0200
Sorting out the learning notes of React beginner -- events
1. Event definition
The name of the React event binding attribute is written in camel style, not lowercase.
If you use JSX syntax, you need to pass in a function as an event handler instead of a string
Define the function in the class component and call it by this. Function name
class GreateH extends React.Component{
static defaultProps = { ...
Added by mdj on Sun, 01 Dec 2019 01:36:31 +0200
Ten minutes to get started status management tool Mobx
What is Mobx
A simple and expandable state management tool
install
npm install mobx --save
Core concept
State
State is the data that drives the application, and the change of state will affect the view.
import {observable, autorun} from 'mobx';
var todoStore = observable({
/* Some observed states */
todos: []
});
Derivations (derivativ ...
Added by cityguru on Thu, 28 Nov 2019 13:11:01 +0200
Comparison of installation steps of each version of react navigation
1.x and 2.x versions
yarn add react-navigation
# or with npm
# npm install --save react-navigation
3.x version
yarn add react-navigation
# or with npm
# npm install react-navigation
yarn add react-native-gesture-handler react-native-reanimated
# or with npm
# npm install react-native-gesture-handler react-native-reanimated
1. If your version ...
Added by BuzzLY on Mon, 18 Nov 2019 08:49:22 +0200
New features of ES6, ES7, ES8, ES9 and ES10
1. New features of ES6 (2015)
class
Modularization
Arrow function
Function parameter defaults
Template string
Destructuring assignment
Extension operator
Object attribute shorthand
Promise
Let and Const
1.1 module
ES5 does not support native modularity, and modules are added as an important part of ES6. The function of the module is mainly co ...
Added by vivek on Fri, 15 Nov 2019 12:23:12 +0200
Using typescript to write react-router 5
No longer advocate centralized routing! Nested routing is no longer the use of {props.children}. Each route is a React component.
react-router-dom
In the web side, you only need to import this package, because it takes a lot of things from the react router.
// @types/react-router-dom/index.d.ts
export { ...... } from 'react-router';
Then look a ...
Added by New Coder on Thu, 14 Nov 2019 11:14:41 +0200