Closed nolimits4web closed 6 years ago
If we have the following code in our JSX components:
if (process.env.COMPILER === 'react') { console.log('i am in react'); } if (process.env.COMPILER === 'vue') { console.log('i am in vue'); }
the compiled code in, for example, Vue component, will be:
if ('vue' === 'react') { console.log('i am in react'); } if ('vue === 'vue') { console.log('i am in vue'); }
which doesn't make much sense. So we need to walk through such simple literal conditions and remove/modify them to:
in react we should have only:
console.log('i am in react');
and in vue:
console.log('i am in vue');
Fixed in https://github.com/phenomejs/phenome/commit/2268a252c1205d396b9b99e34dad76b2227bd699
If we have the following code in our JSX components:
the compiled code in, for example, Vue component, will be:
which doesn't make much sense. So we need to walk through such simple literal conditions and remove/modify them to:
in react we should have only:
and in vue: