0

When i include react-bootstrap-validation v "^0.1.11" i get the following error. My page imports like this;

import React, { Component } from 'react';
import { Grid, Row, Col, Image, Button } from 'react-bootstrap';
import {withRouter} from "react-router-dom";
import contactImage from './../images/contact-img.png';
import { Form, ValidatedInput } from 'react-bootstrap-validation';

page error looks like this

If i remove last line, page works correctly. And my package.json looks like this;

{
 "name": "coinepo-frontend",
 "version": "0.1.0",
 "private": true,
 "dependencies": {
   "babel-loader": "^7.1.2",
   "babel-preset-es2015": "^6.24.1",
   "babel-preset-react": "^6.24.1",
   "bootstrap": "^3.3.7",
   "history": "^4.7.2",
   "moment": "^2.20.1",
   "prop-types": "^15.6.0",
   "react": "^16.2.0",
   "react-bootstrap": "^0.32.1",
   "react-bootstrap-validation": "^0.1.11",
   "react-dom": "^16.2.0",
   "react-redux": "^5.0.7",
   "react-router": "^4.2.0",
   "react-router-dom": "^4.2.2",
   "react-scripts": "1.1.1",
   "redux": "^3.7.2",
   "redux-logger": "^3.0.6",
   "redux-thunk": "^2.2.0"
 },
 "scripts": {
   "start": "react-scripts start",
   "build": "react-scripts build",
   "test": "react-scripts test --env=jsdom",
   "eject": "react-scripts eject"
 }
}

Anyone can help me? Thank you all.

0

1 Answer 1

1

You should downgrade "react-bootstrap": "^0.32.1", to version before <0.30.0

Anything under react-bootstrap <0.30.0 works . For example 0.29.5.

For more info, check this link

The reason is

If you look at version 0.30.0 of React Bootstrap, there is no component named Input, but in React Bootstrap Validation v0.1.11 for the ValidatedInput component, there is a reference to the Input component, which leads to an error: super expression must be null or a function

https://github.com/heilhead/react-bootstrap-validation/pull/67#issuecomment-235331997

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for quick response. When i downgrade react-bootstrap version to 0.29.5, i am getting another error. Says; Cannot read property 'bool' of undefined at PanelGroup.js. Im trying to fix this problem now.
i understand the problem. versions are my problem. i will create project again. if i fix this, i will reply. thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.