Limenius / ReactBundle

Client and Server-side React.js rendering in a Symfony Bundle
MIT License
390 stars 53 forks source link

Unknown "react_component" function. #57

Closed davetaylor closed 2 years ago

davetaylor commented 2 years ago

react-bundle: 5.1 symfony: 5.3.16

Installed react-bundle following the steps in the installation process - but when trying to use react_component in Twig - the Symfony error "Unknown "react_component" function." is thrown

Basic code below.

Body in twig file {{ react_component('TestApp' }}

app.js ``import ReactOnRails from 'react-on-rails'; import TestApp from '../src/JS/Components/Test';

ReactOnRails.register({ TestApp });``

TestApp `const Test = () => { console.log('Rendering Test'); return

Rendering from React component
; }

export default Test;`