after the react project is packaged, the browser can still change the props,state data using react developer tools,. Is this too unsafe? How to solve it?
it has been found that if the data uses a Map object, it cannot be modified.
after the react project is packaged, the browser can still change the props,state data using react developer tools,. Is this too unsafe? How to solve it?
it has been found that if the data uses a Map object, it cannot be modified.
in the code in the production environment, add this line of code before react loads:
Brother found this closed yet? I also encountered the same problem
-
React uses axios to call the background data. After success, how to jump to the page based on the returned value?
1. Write the landing page with react, after calling the background data with axios, judge the route of the page to jump according to the return value, how to jump? 2.axios.get ( login login.action?username= +name+ &password= +pd, {)
timeout: 1000...
-
Can an array in react state be bound to a dom state using an element in the array?
setting in state: this.state = {checkList: []};
checkList initializes it with an array of the same length as JsonPage: this.setState ({checkList:checkSaveCount}); checkSavaCount is the same length as the following JsonPage.
the following creates...
Feb.26,2021
-
React Project Cannot add property style, object is not extensible
import React from react ;
class PublicScreen extends React.Component {
constructor(props) {
super(props);
this.getStyle = this.getStyle.bind(this);
}
getStyle() {
const { width = 1920, height = 1080 } = this.pr...
-
How to put the component from const into return?
renderdphtmldvareturnapiBackend:
apiBackend
...
-
React projects cannot save store? using redux, data
react projects cannot save store? using redux, data
index.js
ReactDOM.render(
<Provider store={store}>
<Router >
< Provider>, document.getElementById( root ))
registerServiceWorker()
actions
export const SET_USER = ...
Feb.26,2021
-
In learning react, I encountered the function super.
this method is included in the constructor of most components, so what exactly is this method for
constructor(props,context){
super(props,context)
}
...
-
How to cancel the page change or refresh of react Antd Design table checkbox
use the Table component of Antd Design, first check out the data, and then select a CheckBox, but when you change pages, that CheckBox will not disappear. For example, when I select the first line on the first page, and then skip to the second page, the ...
Feb.26,2021
-
There is a problem with the operation of React after packaging.
I can run before packaging without any error reports. This problem occurs after packaging. reports such an error in the browser, using scaffolding made by create-react-app, and the back end is Node.js, backend. No error is reported: packages two diff...
Feb.26,2021
-
My websocket can only accept data on newly opened pages.
segmentfault
dvaws.open().websocketwebsocketws
ws.openfetchGETloginsendfetchCOOKIECOOKIEFETCHCOOKIECOOKIE
...
-
How to get the name of input by embedding input in ant design table
...
-
How to generate dom recursively from json by react.createElement
now we need to develop a website to generate front-end pages based on the node ID saved in the database. For example, the json data is:
let data=[
{"id":1,"pid":0,"type":"div"},
{"id":2,"pi...
Feb.26,2021
-
React two unrelated components how does component 2 change when component 1 changes a state
I pass values through redux
scenario is when I click on the navigation bar of component 1 and refresh the ajax of component 2
is the data returned by ajax accepted by this.state.contnet
what should I write? There is an urgent need for ideas.
...
-
React Daily questions the use of, antd select components
official example of full copy: this is the official sample code:
import { Select } from antd ;
const Option = Select.Option;
function handleChange(value) {
console.log(`selected ${value}`);
}
ReactDOM.render(
<div>
<Select defaul...
-
How does react change the value of input
how to use react to change the value of Input
< hr >
export default class myForm extends Component{
constructor(props){
super(props);
this.state = {
id: ,
};
}
change=()=>{
var idIn...
Feb.26,2021
-
What if you want to make the project adaptive in the react project?
want to set the meta tag to solve the adaptive problem
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
meta LOGO
...
-
The option of select cannot be rendered by callback.
use list as the option data source for Select, but use callback, which cannot be rendered. Just call it directly, as shown in the figure below. The first method is fine, and the second is not. Because there are many Select, on a page, you need to use th...
-
Webpack package react, error its MIME type ('text/html') is not executable
< H1 > github address < H1 >
error will be reported when using npm run dev
const path = require( path );
const merge = require( webpack-merge );
const common = require( . webpack.common.js );
dev-server
let BundleAnalyzerPlugin = require( ...
-
In the React project, a piece of code is optimized.
import React from react ;
import ReactDOM from react-dom ;
import . assets styles index.less ;
import Green from . assets images green.png ;
import Red from . assets images red.png ;
class Circle extends React.Component {
constructor...
-
A little doubt about reading the official documents of React
There are two areas in the State and Lifecycle section that I don t quite understand
1. State Updates are Merged
The merging is shallow, so this.setState ({comments}) leaves this.state.posts intact, but completely replaces this.state.comments.
...
Feb.26,2021
-
The elements in an array are all arrays. How do you merge all the elements in an array into one array?
like this [array [xxx], array [xxx], array [xxx].]
merge all xxx in array into one array [xxx.]
...
Feb.26,2021
-
False
-
Django, Why does the system automatically generate an empty session? every time the request is made?
-
Use python to convert dict1 to dict2, in the example. I tried for a long time but couldn't find a solution.
-
How to self-start the php-fpm service when building a LNMP environment with docker?
-
Can an array in react state be bound to a dom state using an element in the array?
-
Wechat browser version 6.6.5 cannot prevent the springback of pull-up and drop-down to the top under ios system.
-
In express+hbs, how do you define the routed data as a variable on the page?
-
How to use symbol reference of Iconfont in dva
-
How to elegantly add data to JSON objects?
-
Using node to build video streaming server
-
The proportional width of the echarts graph is inconsistent.
-
React uses axios to call the background data. After success, how to jump to the page based on the returned value?
-
I don't understand what a linux command means. Please explain it.
-
Vue introduces multiple components in vue-router by nesting named views, and does not refresh the same reference in other pages.
-
Running nodejs reports fewer errors ")"
-
[npm cli] how do I put the configuration of unit tests into cli?
-
How to package components with vue webpack-simple in order to use them directly
-
[python rookie] encountered a problem when writing a simple crawler and could not collect the desired tag
-
In MyBatis, the dynamic SQL constructed by annotations is and by default when splicing multiple Where, and how to modify it to or
-
How does the front end control the progress of css3 animation playback? either css or js method is OK?
Menu