score:1
This is not a full answer but only a demonstration of your code and a suggestion.
Your code looks fine (see example below).
There is a similar issue like you are facing.
One folk wrote:
My problem is caused by npm link. I have 2 libs(A and B) which are both depends on react-bootstrap. B depends on v0.28.3, A depends on v0.29.0. And B depends on A through npm link. It's weird that codes of A will use the packages under B's node_modules. Anyway, update B's package.json to use v0.29.0 solve the issue.
Anyway here is your code running fine:
const { Form, FormGroup, Col, FormControl, Checkbox, ControlLabel, Button } = ReactBootstrap;
class LoginForm extends React.Component {
render() {
return (
<div class="row content">
<Form horizontal>
<FormGroup controlId="formHorizontalEmail">
<Col componentClass={ControlLabel} sm={2}>
Email
</Col>
<Col sm={10}>
<FormControl type="email" placeholder="Email" />
</Col>
</FormGroup>
<FormGroup controlId="formHorizontalPassword">
<Col componentClass={ControlLabel} sm={2}>
Password
</Col>
<Col sm={10}>
<FormControl type="password" placeholder="Password" />
</Col>
</FormGroup>
<FormGroup>
<Col smOffset={2} sm={10}>
<Checkbox>Remember me</Checkbox>
</Col>
</FormGroup>
<FormGroup>
<Col smOffset={2} sm={10}>
<Button type="submit">
Sign in
</Button>
</Col>
</FormGroup>
</Form>
</div>
);
}
}
ReactDOM.render(<LoginForm />, document.getElementById("root"));
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-bootstrap/0.31.3/react-bootstrap.min.js"></script>
<div id="root"></div>
score:0
If error is related to proptype then you may need to import the prop-types ..
import React from 'react';
import PropTypes from 'prop-types'
Source: stackoverflow.com
Related Query
- Heroku, NodeJs and React issue: SCRIPT5007: Unable to get property 'apply' of undefined or null reference
- when trying to connect to mongodb in react app, app crashes with error: Unable to get property 'replace' of undefined or null reference
- Unable to get property 'remove' of undefined or null reference
- Unable to get property 'setState' of undefined or null reference
- React-Bootstrap: TypeError: Unable to get property 'bool' of undefined or null reference
- Unable to get property 'location' of undefined or null reference ReactJS
- Unable to get property 'test' of undefined or null reference
- React: TypeError: Unable to get property 'handler' of undefined or null reference
- Getting "TypeError: Unable to get property 'age' of undefined or null reference" when I try to run
- TypeError: Unable to get property 'text' of undefined or null reference
- Reactjs TypeError: Unable to get property 'string' of undefined or null reference Anonymous function
- Cannot read property 'call' of undefined Webpack Bootstrap React
- How to get over Cannot read property 'removeEventListener' of null in react
- Cannot read property 'then' of undefined - Axios get in React
- Cannot read property 'paginationOption' of undefined in React Bootstrap Typeahead
- Unable to get image using background property in React
- I get the error : - Unhandled Rejection (TypeError): Cannot read property 'id' of undefined in React Application
- my react code is working but when i refresh the page i get TypeError: Cannot read property 'Location' of undefined
- React Cannot read property 'bind' of undefined from constructor/componentDidMount and Unable to set state on unmounted component
- React bootstrap - Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
- Get type error cannot destructure property as it is undefined in React
- React Facebook Login with Enzyme mount - TypeError cannot read property 'parentNode' of undefined
- I get error of TypeError: Cannot read property 'content' of undefined in React
- React - Cannot get property setState of null
- React unable to read property of undefined
- React : TypeError : Cannot read property 'fullname' of undefined
- React js and apexcharts Unhandled Rejection TypeError Cannot read property 'length' of undefined
- React is unable to react property path of undefined
- React - uncaught TypeError: Cannot read property 'setState' of undefined
- TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined raised when starting react app
More Query from same tag
- Event target comes back as null when I try to read it after uploading a file
- Send datas with axios to each change in a input ReactJS
- How do I redirect a success login from Axios to another page?
- How to make radio button auto check in edit page using MongoDB?
- ComponentDidMount() not firing
- React component does not update with the change in redux state
- Detecting user leaves page with custom popup in reactjs
- Why this.state = wrong if this.setState won't work?
- Update a component list after deleting record
- react-chart-js-2 units on y axis
- React Bootstrap Typeahead AsyncTypehead synchronous issue with Redux
- ReactJS:Input on controlled component doesn't change state
- Need explanation of the output. Need to understand the order in hooks & re renders work
- React router same path with other query Param
- Why can't string variable be used in <Image source={}/>? (React Native)
- Specifying an object type in typescript, converting from JS
- Filter does not get applied on change of input text: ReactJS
- Babel giving Unexpted token while building
- Is there a way I can get the country info (code) from the flag selected in react-phone-input-2/material-ui-phone-number
- How to use Font Awesome Icons with Text using ternary operator in React JS?
- Html parser package in React (react-html-parser) is stripping <script> tag
- How Can I implement a function into another different component?
- React MaterialUI Theming | How to increase transition duration when switching theme?
- React Nested Routes throwing error - Meteor
- How do I force a page reload on Hooks state change?
- Accessing event.target inside callback in react
- How to transfer part of logic to another file
- Using keys to call an array for an item list. React.js
- Docusaurus 2 How to add custom react component in navbar
- open file on client stored on server