Can I know the relationship between php's v8js module and reaction?

Asked 2 years ago, Updated 2 years ago, 52 views

Can I know the relationship between php's v8js module and reaction?

You want to configure php as the server language and view as reactjs. But what I'm curious about is

When you install v8js, the reaction is whether you don't need to install it. Through YouTube and other courses, I built a server using webpack and ran the reaction code there. But I don't know how to start at first because I want to use php and reaction together. I downloaded several sources through github and tried to run them, but I couldn't understand them well because there was an error. Please let me know, masters. ㅠ<

Also, I downloaded react-php-v8js-master from github and tried to run it without modifying it, but the following error occurred. V8Js::compileString():1: ReferenceError: Table is not defined It's getting stuck from here. ㅠ<

Currently, I took a picture of hello world through the v8js code. <?php $v8 = new V8Js(); $v8->executeString("print('hello world');"); ?>

Please give me valuable advice...

php reactjs

2022-09-22 14:45

1 Answers

I also had a hard time installing v8js because of my work. LOL

v8js is just an extension that allows php to read JS sources. And the source that we want to get to read here is the React code. Then I need to download the React code to read it, right?

The error means this. V8Js tried to compile (read) a string, but from line 1: Huck: I don't know something: I don't know what Table is If you define var Table = blah blah in the js code to compile, at least that error won't appear.

In fact, [File][2], which is also referred to as file_get_content() in [GitHubRepo][1], defines the Table class.

var Table = React.createClass({
render: function () {
    ...

Because of this, example.php in the above repo outputs 1 through 9 without causing errors.


2022-09-22 14:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.