Questions tagged [react-16]

92 questions
0
votes
0 answers

React: not getting values of the fields

I have the following implementation of the address fields. This will be a re-usable component which can be used with any forms to display address fields such as city, zipcode etc. Now I am able to see address fields in any form by using. import…
Dushyant Joshi
  • 3,672
  • 3
  • 28
  • 52
0
votes
1 answer

React16 Two components communicating

ReactJS Two components communicating, in angular, we are simply using service best way, but here I am new in react 16.
Gopal Meena
  • 107
  • 1
  • 2
  • 8
0
votes
1 answer

React how to delete properties from state

I'm trying to replace whole state or at least delete all properties from it. Before react 16 I just called these two lines this.state = {} this.forceUpdate() With update to react 16, this didn't work anymore. Currently I have this workaround in…
JD2k
  • 48
  • 1
  • 7
0
votes
1 answer

Enzyme not working properly with react 16 (react create app)

I am trying to write some basic tests, but find, closest and other traversing functions seem not to work My setup is react 16 (create-react-app) and jest import React from 'react'; import Overview from './Overview'; import Enzyme, { shallow, mount…
jeff
  • 1,169
  • 1
  • 19
  • 44
0
votes
1 answer

Wrapping multiple react-router routes in error boundary

How do you wrap one or more routes in an error boundary component? I am using React version 16 and have tried wrapping two routes in error boundaries but am experiencing some unexpected behaviour. I do not get any error messages at all - but one…
Kermit
  • 2,865
  • 3
  • 30
  • 53
0
votes
0 answers

setState Before Route Change

I have an authentication state that I use through the Provider/Consumer context API in React 16. I initially set the state of this property in my main App to false and then for any restricted components (i.e. that require being authenticated) I make…
Adam Thompson
  • 3,278
  • 3
  • 22
  • 37
0
votes
0 answers

Upgraded to React v16, seeing Error: parentComponent must be a valid React Component

I added a new component to my project via a private NPM package. It has the following dependencies as indicated in my project's system.config.js: "npm:dialog@0.6.4": { "material-ui": "npm:material-ui@0.19.4", "prop-types":…
Bob Smith
  • 505
  • 3
  • 10
  • 27
0
votes
1 answer

How to use 3rd party react lib with React.Fragments in React 15

Here's my problem Building a React Component Library in React 16.3 and using React.Fragments. Sadly this needs to support a few different React sites including one which includes React 15.4.1. When trying to use a component which has React.Fragment…
StevieB
  • 6,263
  • 38
  • 108
  • 193
0
votes
0 answers

Callback function after window loaded/document ready with ReactJS

Hei, I have an question that how can we callback function when the window is loaded/ document is ready in ReactJS app. In my case, I want to have geolocation and store the location when the React App finish loading so user will have the answer…
trungh13
  • 167
  • 1
  • 3
  • 10
0
votes
1 answer

What happens when I add a module to the Global React object?

Is it expensive to add a module to the 'global' within react? I wish to have a module avilable when needed without having to rely upon importing it into each file. I am adding the following into the 'index.jsx' file: import axios from…
quinton
  • 353
  • 1
  • 6
  • 14
0
votes
2 answers

React 16v - Uncaught TypeError: Cannot read property 'bool' of undefined

I updated my project's react version from 15.3.1 to 16.2.0. I'm getting the following runtime error message. Uncaught TypeError: Cannot read property 'bool' of undefined at eval (Transition.js?0efa:259) at Object.
0
votes
1 answer

Does componentDidCatch() catches error from promise or event handler binded to a component

On React 16, let's say I have a component like class Profile extends React.Component { onClick = () => { throw new Error("Oh nooo!"); }); }; componentDidCatch(error, info) { alert(error) } render() { return (
0
votes
1 answer

How Can I Fix this Error with Karma & React 16.2.0?

I have this Karma configuration (with React 16.2.0): const isArray = require('lodash/lang/isArray'); const merge = require('lodash/object/merge'); const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin =…
0
votes
2 answers

Propagation of setState changes in React

I have an React application that has the following structure: component A is composed of B and C If I call setState in component B, will component A and C be also notified (meaning they will also re-render at least enter reconciliation phase)?
zmii
  • 4,123
  • 3
  • 40
  • 64
0
votes
0 answers

Using React 14 component from React 16 App

We use a React component package which provides some reusable components such as Button, Form, TreeView etc... That package is developed on top of React 14. We want to develop a new application using React 16 and utilize this component package…
Mehmet Ataş
  • 11,081
  • 6
  • 51
  • 78