developit / developit/jsxobj

Support single element or top level arrays

未关闭
#5 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
221
派生
8
PR 合并指标
30 天内没有已合并 PR

描述

Building on @theianjones's proposal in #3.

> 1 open question is how to represent an array with a single element. The only idea I had was fragments like `<>...`. But that would be a separate PR anyway.

Given a component-like function:

```jsx
const Aliases = () => (
<>



)
```

Expect ``:

```json5
[
{
// name: "alias",?
from: "react",
to: "preact-compat",
},
{
// name: "alias",?
from: "react-dom",
to: "preact-compat",
},
]
```

Given:

```jsx
const Resolve = () => (

<>



)
```

Expect ``:

```json5
{
name: "resolve",
alias: [
{
from: "react-dom",
to: "preact-compat",
},
],
}
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。