Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

$this->v8->executeString() needs to be echoed in ReactJS.php #2

@rickmurt

Description

@rickmurt

I did a cURL on the page I set up to verify that PHP had indeed echoed both the markup and the JS, and what I found was that the JS was outputted, but the markup didn't get generated until the page loaded (curl request resulted in <div id="page"></div>). When I inspected the table element, the data was there, so the JS initialized it. If you view source immediately, you'll see an empty #page as well.

Since you have an output buffer in ReactJS::getMarkup(), you have to echo, like so:

ob_start();
*echo* $this->v8->executeString($js);      
return ob_get_clean();

Once I added the echo and did a cURL request, I noticed that the markup was actually there before the JS had a chance to render it.

I'd put in a pull request, but I just wanted to verify that this was intended behavior and I wasn't missing anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions