vendredi 1 décembre 2017

Laravel 5.5 React

I am trying to use the default React scafollding that Laravel 5.5 provides.

So my steps so far are

1) Install fresh 5.5 laravel application

2) php artisan make:auth

3) php artisan migrate

4) php artisan preset react

5) npm install // the followin 2 steps are just for watchin my react files so I dont have to build manualy after changes

6) npm install react-router@2.8.1

7) npm run watch

8) I added `' 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 exmaple <div id="example"></divbut this also doesn't display the example component.

Anyone knows what I am doing wrong here.

I get no erros when building so I have no clue why it is not working.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2BrNZe2
via IFTTT

Aucun commentaire:

Enregistrer un commentaire