Questions tagged [React] (2958)

3
answers

How to insert to React the external div?

There are a variety of services (design forms and surveys) who say that you need to insert to the site of their script and some sort of div, in order to generate dynamic elements ( <div id="999" data-id="999"></div>) I have BrowserRouter, which leads to the page /contact. And it turns out my first SPA renders th...
leila asked April 19th 20 at 12:47
1
answer

What we do build in create-react-app?

Good evening, this is not a very smart question: I recently write on react'e projects. The entire Assembly is reduced to create the installation-react-app. It puts all the dependencies and configures the server for us, at the end we have the server ready that can be run on port 3000. It's all clear The question is. The off...
edna.Tremblay asked April 19th 20 at 12:47
1
answer

How to write a hook useState if the state of multiple properties?

There is a class component which needs to be converted into a functional state and redo to hook useState. But to state a few properties: class App extends React.Component { state = { num: 0, text: 'no' textUpper: 'HELLO' } changeState = () => { this.setState({ num: this.state.num + 1, text: "yes", textUpper: 'B...
Rodger.Batz asked April 19th 20 at 12:45
1
answer

How to copy state Redux in state of the component with hooks?

I need to do a live search. To do this, I get a list of posts from Stora Redux const posts = useSelector(state => state.posts); Create a filtered list in state component const [state setState] = useState({ postsFiltered: [] }) Make a request to the backend to Redux appeared posts and when they appear (2) state of t...
Alex_Bergna asked April 19th 20 at 12:42
0
answer

Why fetch sometimes returns a malformed response?

A common example of fetch fetch("https://api.example.com/items", {"method":"post","body": JSON.stringify(data)) .then(res => res.json()) .then( (result) => { }, (error) => { } ) On the LAN returns a normal response of type result = "{"a":"b"}" and on server, add it to the header and have something like result ...
Aurore.Farrell21 asked April 19th 20 at 12:39
1
answer

How to add JSX support in React?

Good day! Faced such problem that at startup the files from the documentation they React incorrectly displayed. There are two HTML file: <!DOCTYPE html> <html> the <head> <meta charset="UTF-8" /> <title>Add React in One Minute</title> </head> the <body> <h2>Add React...
Junius asked April 19th 20 at 12:39
3
answers

How to track event to add text to the input?

Create a form, it is necessary that when entering text in input is triggered a function, that when you enter, if you remove text, no action should occur. How it can be implemented? Thanks in advance for your help.
marley.Brekke26 asked April 19th 20 at 12:39
0
answer

How to typecast the return value of the Thunk of action?

Hi. The situation is this: 1) There is an asynchronous action type AppThunk<ReturnType = void> = ThunkAction< ReturnType, RootState, unknown, Action<string> > export const registerUserAsync = (form: RegisterFormType): AppThunk<Promise<RegisterFormType>> => { return dispatch => new Pr...
Federico44 asked April 19th 20 at 12:38
1
answer

How to get the status value from this.state.data?

constructor(props) { super(props) this.state = { data : [ { key: 1, id: 1, name: 'Ivan Ivanov', status: true, feedback: 'Excellent work, I will advise all', }, { key: 2, id: 2, name: 'Peter Petrov', status: false, feedback: 'Made cool, thank you very much', }, ] } this.columns = [ { title: 'id', dataIndex: ...
Olaf52 asked April 19th 20 at 12:37
1
answer

How to make to set up the room on which I clicked?

When you click on the link "Call" must be substituted by a number from this.state.data export default class CallBack extends Component { constructor(props) { super(props) this.state = { data : [ { key: 1, id: 1, name: 'Ivan Ivanov', phone: '+79882522312', }, { key: 2, id: 2, name: 'Smith', phone: '88005553535',...
Emanuel_Ondricka asked April 19th 20 at 12:36