I've started working on a project with uses ReactJS that I'm new to and I don't understand the structure of the React components, it doesn't look like most examples I find in tutorials. This is pretty much what I got from the structure now:
React are loaded via downloaded javascripts in html file:
<script src="vendor/babel.min.js"></script>
<script src="vendor/react.production.min.js"></script>
<script src="vendor/react-dom.production.min.js"></script>
<script src="vendor/reactstrap.min.js"></script>
A typical component in the project looks like this:
export default class ExamplePage extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return <p>Example page</p>
}
}
From most examples I see in tutorials, they start with:
import React from 'react';
Why is that not needed here? There is also no package.json file from npm to be found in the project at all, just a vendor map with all of the libraries used.
Further on, I now would like to use the Input component from reactstrap, so I downloaded it from cdn:
https://cdnjs.cloudflare.com/ajax/libs/reactstrap/4.8.0/reactstrap.min.js
and added a reference to it similar to the first code snippet and changed render method above to:
render() {
return (
<div>
<p>Buy orders</p>
<Input type="email"
name="email"
className="border-right-0"
placeholder="Enter email"/>
</div>
)
}
But I'm getting "Input is not defined" in console output once it runs, it obviously can't find the component.