Yii 2.0: yii2-react

React.js and JSXTransformer Assets

React.js Extension for Yii 2

React.js and JSXTransformer.js Assets


The preferred way to install this extension is through composer.

Add to the require section of your composer.json file:

"opw/yii2-react": "dev-master"

And run in terminal

composer update

If you see the following error message:

Your requirements could not be resolved to an installable set of packages.

Change in the composer.json file

"minimum-stability": "dev",

And add

"prefer-stable": true,


Add to assets/AppAsset.php file:

'opw\react\JSXTransformerAsset', // optional

For don't use JSXTransformer, use react-tools and add your JSX compiled files in AppAsset.php:

public $js = [

Further Information

Please, check the React.js site documentation for further information about its configuration options.


Web & Mobile development

Total 2 comments

#20065 report it
Peregrine at 2017/04/13 09:33am
JSXTransformer.js is not present

JSXTransformer.js is not only not being added to the web assets directory, but the source JS file doesn't seem to exist at all from what I can tell.

#19927 report it
namsir at 2016/08/18 11:30am

Nice. I am going to play around with this when i have time. thank you.

Leave a comment

Please to leave your comment.

Create extension