Questions tagged [react-16]

92 questions
1
vote
0 answers

Cannot Render images in React while using Server Side Rendering after creating Build ,Cannot GET /[object%20Object]

I used create-react-app to create a React project. I was experimenting with server-side rendering on express servers. I found a code snippet that showed me how to do it. ReactDOM.hydrate(
1
vote
0 answers

trying to upgrade react program from 16 to 17

I am working with an older react app that was built by someone before and I am being asked to work on it. I'd like to update it from React 16.13.1 to React 17 that way I can install Material UI v5 for access to the new features. Whenever I try 'npm…
Zach philipp
  • 125
  • 6
1
vote
0 answers

React - accessing context in child components

I am using this react package - @spyna/react-store (link) in my project which is nothing but a wrapper for React Context API - createStore & withStore. But I am not able to access the react context api store values in my child component (which I set…
user972255
  • 1,828
  • 10
  • 32
  • 52
1
vote
2 answers

React 16 upgrade - select lists return Object Object

I've got an app I'm upgrading from React 15 to React 16 In some instances of mapping and using a select list which were working in React 15 are now not working - I'm finding that the select list are returning a list of [object, Object] Here's my…
Neil Kelsey
  • 811
  • 4
  • 13
  • 31
1
vote
1 answer

The react context from the child does not change

I read the solution from a similar question but it did not help. Here is my simple code: https://codesandbox.io/s/gracious-jennings-ugqzd import myContext from "./myContext"; import Two from "./Two.js"; class App extends React.Component { …
Puffy
  • 13
  • 2
1
vote
1 answer

How to reuse SASS variable in JavaScript

I have list of color variables in JavaScript file as an Object. export const colors = [ { colorVariable: "$ui-background" }, { colorVariable: "$ui-01" }, { colorVariable: "$ui-02" }, ... ] I created above object file based on scss file…
ketan
  • 19,129
  • 42
  • 60
  • 98
1
vote
0 answers

state hook in functional component (react 15.5.4)

how I can manipulate state in functional component without using hook state? because it 's supported after 16.x version. I can't update current react version (it's very old and stability project). The problem is in the libraries used in the project,…
1
vote
1 answer

Facing issue while upgrading React Version 15.6.2 to 16.6.3

Upgrading react version from 15.6.2 to 16.2.0. But facing below issues while running build of the application, ERROR in ../node_modules/react-addons-update/index.js [INFO] Module not found: Error: Can't resolve 'react/lib/update' in …
1
vote
0 answers

Sentry User feedback modal not popping up onClick

I already setup sentry and it works and sends the bugs correctly, currently i'm making a "something has gone wrong page" with a report feedback button, problem is that the modal does not pop up on clicking the button, here is the…
Mohamed Baher
  • 151
  • 1
  • 9
1
vote
1 answer

TypeError: plugin.test is not a function when using jest, enzyme and react-16, typescript

I'm in the process of updating my react app to react-16, but all my tests brake. I have upgraded enzyme, jest-enzyme, react-dom, installed the enzyme-adapter , created the setupTest.ts enzyme file, updated my jestconfig.js file but I'm still getting…
intercoder
  • 2,171
  • 7
  • 23
  • 34
1
vote
0 answers

React Components inside fragment not loading

I'm using react 16.2.0 and react-dom 16.2.0. Following is the code I have. import React, { Fragment } from 'react'; import BodyComponent from './BodyComponent'; import * as HeaderComponents from './HeaderComponent'; class TablePage extends…
1
vote
1 answer

withRouter HOC and getDerivedStateFromProps

I am trying to use getDerivedStateFromProps in a component as follows: class MyComponent extends React.Component { constructor(props) { super(props); this.state = { location: '', }; } static…
proko
  • 175
  • 2
  • 11
1
vote
1 answer

How to identify moment something executed in Flame graph in DevTools?

I'm using React 16 (Fiber engine) and need to see/identify specific moment in Main thread section to see what is happening after it. Thus I come up with idea to put some code that will create some spike there and will enable me to see exact spot on…
zmii
  • 4,123
  • 3
  • 40
  • 64
0
votes
2 answers

Rendering a div element inside existing div during page rendering

I'm stuck at rendering a component insider a div. My code is like below, I want to render the div with classname RequestNewOrgBtn inside the parentDiv. How can I do it at runtime of render? const labelItem = …
shanky
  • 751
  • 1
  • 16
  • 46
0
votes
0 answers

Force React to treat an update as low priority

I see that react 18 has some cool hooks to help manually control the priority of state updates (useDeferredValue and useTransition) and using these methods fixes some performance issues that I have on a table. But React 18 isn't stable yet! So I am…
shallow.alchemy
  • 530
  • 4
  • 14