I saw a lot of tutorials with code that suggests doing something like the following:
var App = React.createClass({
someFunction() { .. },
render() { return(); },
});
var Lication = React.createClass({
someOtherFunction() { .. },
render() { return(); },
});
... but I used the ES6 syntax:
class App extends Component {
someFunction() { .. }
render { return(); }
}
Where can I create a class Lication? Right under the App class? Or you need its own file and is imported into the main file with something like:
var Lication = require('./Lication');
I still need to see code that uses several classes.
source
share