Laravel 5.5 render a React component in a blade view with data from the controller

后端 未结 3 1952
一生所求
一生所求 2021-02-09 11:30

My goals is to be able to do something like this in my blade view.

name }}\" />

But this doesn\'t render any

3条回答
  •  伪装坚强ぢ
    2021-02-09 12:33

    I do it like this eg. in index.blade.php

    Then in Main.js

    const Main = (props) => {
      return (
        
    ); } if(document.getElementById('main')) { const el = document.getElementById('main') const props = Object.assign({}, el.dataset) ReactDOM.render(
    , el); }

提交回复
热议问题