create-react-app version 2.0 added a lot of new features. One of the new features is upgrading to Babel Version 7, which enables the Short Syntax of React Fragments. Fragments have been a feature of React since version 16.2, but the Short Syntax hasn’t been available since Babel 7.0. Fragments let you wrap a group of children without adding an extra node to the DOM, which is helpful if you need a specific DOM structure.

import React, { Component, Fragment } from "react";
import "./App.css"; const Content = () => (
<>
<nav>Navigation</nav>
<main>Main area</main>
</>
); class App extends Component {
render() {
return (
<div className="App">
<header>Header</header>
<Content />
<footer>Footer</footer>
</div>
);
}
} export default App;

[React] Use the Fragment Short Syntax in Create React App 2.0的更多相关文章

  1. [React] {svg, css module, sass} support in Create React App 2.0

    create-react-app version 2.0 added a lot of new features. One of the new features is added the svgr  ...

  2. 使用create react app教程

    This project was bootstrapped with Create React App. Below you will find some information on how to ...

  3. tap news:week5 0.0 create react app

    参考https://blog.csdn.net/qtfying/article/details/78665664 先创建文件夹 安装create react app 这个脚手架(facebook官方提 ...

  4. 利用 Create React Native App 快速创建 React Native 应用

    本文介绍的 Create-React-Native-App 是非常 Awesome 的工具,而其背后的 Expo 整个平台也让笔者感觉非常的不错.笔者目前公司是采用 APICloud 进行移动应用开发 ...

  5. template标签就相当于React中的fragment

    template标签就相当于React中的fragment

  6. 如何扩展 Create React App 的 Webpack 配置

    如何扩展 Create React App 的 Webpack 配置  原文地址https://zhaozhiming.github.io/blog/2018/01/08/create-react-a ...

  7. 深入 Create React App 核心概念

    本文差点难产而死.因为总结的过程中,多次怀疑本文是对官方文档的直接翻译和简单诺列:同时官方文档很全面,全范围的介绍无疑加深了写作的心智负担.但在最终的梳理中,发现走出了一条与众不同的路,于是坚持分享出 ...

  8. how to create react custom hooks with arguments

    how to create react custom hooks with arguments React Hooks & Custom Hooks // reusable custom ho ...

  9. 在 .NET Core 5 中集成 Create React app

    翻译自 Camilo Reyes 2021年2月22日的文章 <Integrate Create React app with .NET Core 5> [1] Camilo Reyes ...

随机推荐

  1. 输入防抖 vue # 输入搜索的时候 及时搜索的快速访问接口的 解决方案 vue 中使用防抖和节流

    输入防抖 watch: { value (newVal, oldVal) { if (this.timer) { clearTimeout(this.timer) } this.timer = set ...

  2. com组件简单应用

    1.打开VS2010,新建ATL COM 项目,步骤:“文件” -->“新建” -->“项目”,选择“Visual C++” -->“ATL 项目” ,填写“名称” FirstCOM ...

  3. python爬虫---从零开始(三)Requests库

    1,什么是Requests库 Requests是用python语言编写,基于urllib,采用Apache2 Licensed 开源协议的HTTP库. 它比urllib更加方便,可以节约我们大量的工作 ...

  4. PHP01 LAMP网站构建

    学习要点 什么是web? 开发动态网站所需的web构件? 几种主流web应用程序平台? HTTP协议与web的关系? Web的工作原理? LAMP网站开发组合概述? 如何学习PHP? 什么是Web? ...

  5. (二十二)python 3 sort()与sorted()

    Python list内置sort()方法用来排序,也可以用python内置的全局sorted()方法来对可迭代的序列排序生成新的序列 一,最简单的排序 1.使用sort排序 my_list = [3 ...

  6. 【pwnable】asm之write up

    首先查看源代码: #include <stdio.h> #include <string.h> #include <stdlib.h> #include <s ...

  7. 03002_Http请求协议分析

    1.编写一个form.html的表单页面 (1)使用EclipseEE新建一个动态的web项目: (2)Dynamic web module version选择2,5版本: (3)新建一个form.h ...

  8. hls简述(HTTP live Streaming)

    hls官方地址:https://developer.apple.com/streaming/ IDR: Instantaneous Decoding Refresh (IDR) start code ...

  9. 《Docker容器与容器云》读书笔记

    云计算平台 云计算是一种资源的服务模式,该模式可以实现随时随地.便捷按需地从可配置计算资源共享池中获取所需资源(如网络.服务器.存储.应用及服务),资源能够快速供应并释放,大大减少了资源管理工作开销. ...

  10. 【RMAN】RMAN跨版本恢复(下)--大版本异机恢复

    [RMAN]RMAN跨版本恢复(下)--大版本异机恢复 BLOG文档结构图 ORACLE_SID=ORA1024G 关于10g的跨小版本恢复参考:http://blog.chinaunix.net/u ...