I am trying to use the default React scaffolding that Laravel 5.5 provides.
So my steps so far are
- Install fresh 5.5 laravel application
- php artisan make:auth
- php artisan migrate
- php artisan preset react
- npm install
The followin 2 steps are just for watchin my react files so I dont have to build manualy after changes
npm install [email protected]
npm run watch
I added
<Example />in the default register view.
This should display the Example component provided by Laravel or am I mistaken?
Example component:
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
export default class Example extends Component {
render() {
return (
<div className="container">
<div className="row">
<div className="col-md-8 col-md-offset-2">
<div className="panel panel-default">
<div className="panel-heading">Example Component</div>
<div className="panel-body">
I'm an example component!sdjf
</div>
</div>
</div>
</div>
</div>
);
}
}
if (document.getElementById('example')) {
ReactDOM.render(<Example />, document.getElementById('example'));
}
I also tried just adding a div with id: example but this also doesn't display the example component.
I have the chrome react developer tools and it says that my page is using react so there is no issue there. I don't see the component in my view nor in my dev tools.
I get no errors when building so I have no clue why it is not working.
php artisan preset reactandnpm install && npm run devbut the <Example /> component doen't work in the welcome.blade.php view. Any tip on what I'm missing? - AngelGris