我们有一个使用reactjs开发的小部件的稳定版本.我们想开发相同的移动版本.使用react native进行开发并在2个应用程序之间共享代码是否更好?或者我们更好地本地开发小部件.
请记住,我们在两者(反应和Android开发者)都有专业知识,但我们不想投入太多时间再次开发整个应用程序.
如果我们选择react-native,是否有任何工具/资源可以更快地完成这项工作?
在线资源:
http://jkaufman.io/react-web-native-codesharing/
https://arielelkin.github.io/articles/why-im-not-a-react-native-developer.html
干杯!!!
我有一个可选的 propType
static defaultProps = {
onSort: undefined, // undefined | () => {}
}
Run Code Online (Sandbox Code Playgroud)
如果未定义,我们将undefined在调用函数之前进行检查。
_handleSort = () => {
this.props.onSort && this.props.onSort()
}
Run Code Online (Sandbox Code Playgroud)
那么,我如何处理 type 的 propType Function | undefined。我应该在调用函数之前检查 undefined 还是定义默认函数() => {}
我有一个没有 doctype 声明部署到服务器的 html 页面(比如 A)。这是从另一台服务器(比如 B)获取 js 文件。Node.js 创建必要的 html 页面来显示。现在 IE8 正在创建问题,因为没有声明 doctype(将自身设置为 IE5 quirks 模式)
现在 doctype 是读取的第一行,这似乎不可能通过这种方式完成(使用 js 设置 doctype)。是否可以设置元标记来将页面设置为标准模式?或者有没有其他我可以将页面设置为标准页面而无需修改来自服务器 A 的 html 页面。
我试图安装ruby-2.1.2时出现以下错误
rvm install ruby-2.1.2
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/12.04/x86_64/ruby-2.1.2.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system................
Error running 'requirements_debian_update_system ruby-2.1.2',
showing last 15 lines of /usr/local/rvm/log/1400060285_ruby-2.1.2/update_system.log
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
For 404 errors check your sources configured in: …Run Code Online (Sandbox Code Playgroud) js有问题吗?
if("hello".indexOf("world")) { // I forgot to add > -1 here
console.log("hello world");
}
Run Code Online (Sandbox Code Playgroud)
基本上if(-1)是真的.这怎么可能?我花了一整天才解决这个问题.是否列出了列出这些类型的列表?或者可以用来捕捉这些东西的工具.
有什么区别
$('div').on('click', function() {
alert(1);
});
Run Code Online (Sandbox Code Playgroud)
和
$(document).on('click', 'div', function() {
alert(1);
});
Run Code Online (Sandbox Code Playgroud) javascript ×4
reactjs ×3
css ×1
doctype ×1
html ×1
jquery ×1
react-native ×1
react-table ×1
ruby ×1
rvm ×1
truthiness ×1