File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,19 @@ For a walkthrough how to setup V8Js PHP extension, use the links below:
1414- [ On Windows] ( https://github.com/preillyme/v8js/blob/master/README.Win32.md )
1515
1616## Usage
17+ 1 . Prepare or create ReactJs Bundle Script
18+ ``` javascript
19+ import React from ' react'
20+ import ReactDOM from ' react-dom' ;
21+ import ReactDOMServer from ' react-dom/server' ;
22+ import HelloWorldComponent from " ./HelloWorldComponent" ;
1723
24+ window .React = React;
25+ window .ReactDOM = ReactDOM;
26+ window .ReactDOMServer = ReactDOMServer;
27+ window .HelloWorldComponent = HelloWorldComponent;
28+ ```
29+ 2 . Put ReactJs bundle script to ` ViewReactSource `
1830``` php
1931use Arryanggaputra\ViewReact;
2032use Arryanggaputra\ViewReactSource;
@@ -25,6 +37,7 @@ echo $view->render('HelloWorldComponent', [
2537 'name' => 'Jon',
2638]);
2739```
40+
2841### Result
2942``` html
3043<div data-reactid =" 11" ><div data-reactid =" 12" ><h1 data-reactid =" 13" >Hello World <b >John</b ></h1 ></div ></div >
You can’t perform that action at this time.
0 commit comments