Skip to content

Commit 76ade86

Browse files
committed
Modified the code to render the react elements with props
1 parent c874f09 commit 76ade86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

application/views/react/content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$include_file = "/js/react/components/{$_module_name}.js";
66
?>
77
System.import('<?php echo $include_file; ?>').then(function(module) {
8-
var props = {}
8+
var props = '<?php echo json_encode($react_vars, JSON_FORCE_OBJECT); ?>'
99
ReactDOM.render( React.createElement(module.default, props), document.getElementById('content') )
1010
})
1111
</script>

0 commit comments

Comments
 (0)