Closed PierBover closed 8 years ago
When using react-templates with react-native the docs say:
react-templates
react-native
In native mode the default modules option is set to commonjs and the default react-import-path is set to react-native.
But when using --native with the CLI the modules are not set to commonjs, nor the import path is set to react-native.
--native
Here is the proof.
tr template.rt --native returns:
tr template.rt --native
var templateRT = function () { return React.createElement(React.View, {}, React.createElement(React.Text, {}, 'Hola')); };
tr template.rt --native --modules commonjs returns:
tr template.rt --native --modules commonjs
'use strict'; var React = require('react/addons'); var _ = require('lodash'); module.exports = function () { return React.createElement(React.View, {}, React.createElement(React.Text, {}, 'Hola')); };
And finally rt template.rt --modules commonjs --native --react-import-path react-native returns:
rt template.rt --modules commonjs --native --react-import-path react-native
'use strict'; var React = require('react-native'); var _ = require('lodash'); module.exports = function () { return React.createElement(React.View, {}, React.createElement(React.Text, {}, 'Hola')); };
When using
react-templates
withreact-native
the docs say:But when using
--native
with the CLI the modules are not set to commonjs, nor the import path is set toreact-native
.Here is the proof.
tr template.rt --native
returns:tr template.rt --native --modules commonjs
returns:And finally
rt template.rt --modules commonjs --native --react-import-path react-native
returns: