React answers

  • 0answers
    How to redirect from https://www.google.com/ to https://www.google.com?
    How to use https://reactrouter.com/web/api/Redirect redirect with href = "https://www.google.com/" rel = "nofollow"> https://www.google.com/ to https://www.google.com (differences only at the end of /) & lt; Redirect from = "/ old-path" to = "????" / & gt;
    React Lucy Wilkinson, Jan 12, 2020

  • 0answers
    How to send axios request to Firebase from local hosting, CORS interferes now?
    Good day! I'm currently taking one of the React courses and ran into one problem. The problem is that due to CORS rules, I cannot access another domain from the local host. There are many methods on the net, but many I do not know how to use in my case. I am using the default application ...
    React Anonymous, Sep 8, 2019

  • 0answers
    How to make styled-components more reusable?
    After some time working on a project where styled-components is used for layout, I began to catch myself thinking that very often I have to copy and paste pieces of code like: display: flex;flex-direction: row;width: 100%; Of course, the "backbone" parameters, like theme colors, fonts, etc. are ...
    React Anonymous, Nov 2, 2019

  • 0answers
    How to fix NODE_ICU_DATA?
    Good day. We sent the project, after yarn install and yarn start I get the following response. I couldn't find a solution on the internet. $ NODE_ICU_DATA = "$ (pwd) / node_modules / full-icu" babel-node --extensions ".ts" tools / run start "NODE_ICU_DATA" is not internal or external ...
    React Archer Cross, Sep 22, 2019

  • 0answers
    How to close all open tooltips when clicking on a closed one in React?
    There is a working code for opening a tooltip. But how to close all open ones when you click on a closed one? I would like to do it without third-party packages. import React from "react";import cn from "classnames";class Tooltip extends React.Component { constructor() { super(); ...
    React Nathaniel Fox, Nov 26, 2020

  • 0answers
    How to combine react and api on asp.net core?
    I wrote front and am trying to connect to the api using axios: I run api via vs, a page appears where data from the database is displayed in json format. And then they start the front through vsc (I write npm start). A page is opened on which no data is displayed. Maybe you need to somehow ...
    React Anonymous, Nov 7, 2019

  • 0answers
    How do I properly configure environment variables for Netlify?
    Hello everyone, I am unable to set the environment variables for running the application on Netlify. I've added all the variables to Site Settings / Environment, but either that's not enough, or I've configured something wrong. Everything works locally, in dev and prod modes. PS ...
    React Anonymous, Jun 3, 2019

  • 0answers

  • 0answers
    How to generate html when building a react.js application?
    There is a project written in React.js. In fact, these are laid out blocks that are broken down into react components. In these components, the logic is partially implemented: switching tabs, switches and all sorts of things. When building a project in production, I get one index.html page, to ...
    React Elisabeth Hernandez, Dec 8, 2020

  • 0answers
    Does the routing have to be inside app.js?
    I read about routing in react, and everywhere examples are given inside app.js. But for me, for example, it would be convenient to register routing inside another file, one nesting level below. for example: app.js would look like this: class App extends React.Component{ render() { ...
    React Emerson Sanford, May 29, 2020

  • 0answers
    How to make one instead of multiple render calls?
    There is a function where several different setState (setState1, setState2, setState3) are called and the component is rendered three times. Why doesn't React optimize the three setState calls? If I'm not mistaken, it says in the dock that React will optimize multiple calls to setState. Or ...
    React Anonymous, May 25, 2019

  • 0answers
    When will this useEffect work?
    In the code below, useEffect in dependencies stores a link to the handler, as I understand it will be constant, due to the fact that the handler is wrapped in useCallback, i.e. the handler seems to never change, then what's the point of specifying it in the dependency array? const handler = ...
    React Anonymous, Jan 23, 2020

  • 0answers
    How do I organize my application on a React + TS + GraphQL + MobX stack?
    Good afternoon, tell me how best to organize the structure of the application on the React + TS + GraphQL + MobX stack. Specifically, I'm interested in how to initialize the global state in the MobX + GraphQl bundle. The data comes on request from the GraphQL server. Advise good practices, or ...
    React Anonymous, Feb 13, 2020

  • 0answers
    Where can you find similar chat libraries?
    Hello. Please advise someone similar chat libraries as on dromru. So that you can switch between tabs and there is a smooth animation. Thank you.
    React Lucas Daniels, Aug 17, 2019

  • 0answers
    How to speed up rendering after changing input?
    Hello everyone. My project slows down due to changes in inputs. I, as expected, hung up an event handler so that after every value change in input, dispatch is called and the new value is passed to state and then displayed. How is changing input fields usually optimized in React projects? A ...
    React Anonymous, Oct 6, 2019

  • 0answers
    How to show the native calendar of the device itself on the phone, including iOS?
    There is a site in React. There is a date field. It is necessary that the native calendar of the device be called in the mobile version. Input type = "date" is not suitable as it still does not work in iOS, Safari. All the datapickers I found are custom ones. Can anyone have any solutions in this ...
    React Anonymous, Jul 29, 2019

  • 0answers
    Why doesn't ref "anchor" the element to the right place?
    There is a DatePicker component. This is the button, by clicking on which the calendar should open, to select the date. I'm using the material-ui component. In general, a ref is created in the parent component. const datePickerRef = useRef (); Then the ref is passed to the DatePicker ...
    React Adam Howe, Oct 20, 2019

  • 0answers
    How to fix the error with InMemoryCache so as not to lose the results of previous queries in GraphQL?
    In a React application, I made infinite scrolling, requesting data from a GraphQL query. But I incorrectly implemented caching of previous loaded results, as a result of which, when scrolling, new results are not added to the previously loaded ones, but replace them. I use Apollo, I did it ...
    React Anonymous, Jun 29, 2020

  • 0answers
    What development approach should you take to create an online quiz (game)?
    The task is to implement an online quiz, where users, when starting a certain game, connect either to the room where the player expects or creates his own and waits for the players. There can be 2 players in the room at the same time and the essence of the games is that they answer questions and, ...
    React Delilah Lucas, Jan 30, 2019

  • 0answers
    Why isn't the component rendered after overwriting the array?
    The essence of the question is as follows. There is an array of elements. After the main render, I rebuild it due to the fact that the elements simply do not fit in the layout. I need to do this after the main render because I need to know the width of the received container. I write the elements ...
    React Anonymous, Dec 3, 2020