传播运算符,以应对意外令牌的抛出错误 [英] spread operator in react throwing error of Unexpected token

查看:63
本文介绍了传播运算符,以应对意外令牌的抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在其中包含扩展运算符

Here is the code where I have included spread operator

style={{ ...styles.detailsRow.icon, alignSelf: 'centre' }}


我需要安装或添加哪些东西才能使其运行?


What things do I need to install or add to make it run?

还有es2015中的等效项是什么?

And also what is its equivalent in es2015?

推荐答案

您需要配置Babel以使用transform-object-rest-spread插件. 有关详细信息,请参见以下链接: https://babeljs.io/docs/插件/transform-object-rest-spread/

You need to configure Babel to use the transform-object-rest-spread plugin. Refer to the following link for details: https://babeljs.io/docs/plugins/transform-object-rest-spread/

这篇关于传播运算符,以应对意外令牌的抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆