This is the second tutorial that I am following due to failure in versions and dependencies in the earlier. As you can guess I am just trying to get started with react here.
I created a controller called Appointments. This is my controller jsx inside the components folder.
app/assets/js/components/appointments.jsx
var Appointments = React.Component({
render: function() {
return (
<h1>React calender</h1>
)
}
});
appointments/index.html.erb
<%= react_component 'Appointments' %>
And I restarted rails server. All I see is a blank browser and console showing this
Uncaught ReferenceError: Appointments is not defined
class Appointments extends React.Componentvar Appointments = React.Component, tryclass Appointments extends React.Component});in appointments.jsx. Sayingunexpected token