---
source: crates/react_hermes_parser/tests/parser_test.rs
expression: "format!(\"Input:\\n{input}\\n\\nOutput:\\n{output}\")"
input_file: crates/react_hermes_parser/tests/fixtures/error._todo.multi-arrow-expr-export-default-gating-test.js
---
Input:
// @gating
const ErrorView = (error, _retry) => <MessageBox error={error}></MessageBox>;

export default Renderer = (props) => (
  <Foo>
    <Bar></Bar>
    <ErrorView></ErrorView>
  </Foo>
);


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "VariableDeclaration",
      "kind": "const",
      "declarations": [
        {
          "type": "VariableDeclarator",
          "id": {
            "type": "Identifier",
            "name": "ErrorView",
            "typeAnnotation": null,
            "loc": null,
            "range": [
              17,
              26
            ]
          },
          "init": {
            "type": "ArrowFunctionExpression",
            "id": null,
            "params": [
              {
                "type": "Identifier",
                "name": "error",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  30,
                  35
                ]
              },
              {
                "type": "Identifier",
                "name": "_retry",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  37,
                  43
                ]
              }
            ],
            "body": {
              "type": "JSXElement",
              "openingElement": {
                "type": "JSXOpeningElement",
                "name": {
                  "type": "JSXIdentifier",
                  "name": "MessageBox",
                  "loc": null,
                  "range": [
                    49,
                    59
                  ]
                },
                "attributes": [
                  {
                    "type": "JSXAttribute",
                    "name": {
                      "type": "JSXIdentifier",
                      "name": "error",
                      "loc": null,
                      "range": [
                        60,
                        65
                      ]
                    },
                    "value": {
                      "type": "JSXExpressionContainer",
                      "expression": {
                        "type": "Identifier",
                        "name": "error",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          67,
                          72
                        ]
                      },
                      "loc": null,
                      "range": [
                        66,
                        73
                      ]
                    },
                    "loc": null,
                    "range": [
                      60,
                      73
                    ]
                  }
                ],
                "selfClosing": false,
                "loc": null,
                "range": [
                  48,
                  74
                ]
              },
              "children": [],
              "closingElement": {
                "type": "JSXClosingElement",
                "name": {
                  "type": "JSXIdentifier",
                  "name": "MessageBox",
                  "loc": null,
                  "range": [
                    76,
                    86
                  ]
                },
                "loc": null,
                "range": [
                  74,
                  87
                ]
              },
              "loc": null,
              "range": [
                48,
                87
              ]
            },
            "generator": true,
            "async": false,
            "loc": null,
            "range": [
              29,
              87
            ],
            "expression": true,
            "loc": null,
            "range": [
              29,
              87
            ]
          },
          "loc": null,
          "range": [
            17,
            87
          ]
        }
      ],
      "loc": null,
      "range": [
        11,
        88
      ]
    },
    {
      "type": "ExportDefaultDeclaration",
      "declaration": {
        "type": "AssignmentExpression",
        "operator": "=",
        "left": {
          "type": "Identifier",
          "name": "Renderer",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            105,
            113
          ]
        },
        "right": {
          "type": "ArrowFunctionExpression",
          "id": null,
          "params": [
            {
              "type": "Identifier",
              "name": "props",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                117,
                122
              ]
            }
          ],
          "body": {
            "type": "JSXElement",
            "openingElement": {
              "type": "JSXOpeningElement",
              "name": {
                "type": "JSXIdentifier",
                "name": "Foo",
                "loc": null,
                "range": [
                  132,
                  135
                ]
              },
              "attributes": [],
              "selfClosing": false,
              "loc": null,
              "range": [
                131,
                136
              ]
            },
            "children": [
              {
                "type": "JSXText",
                "value": "\n    ",
                "raw": "\n    ",
                "loc": null,
                "range": [
                  136,
                  141
                ]
              },
              {
                "type": "JSXElement",
                "openingElement": {
                  "type": "JSXOpeningElement",
                  "name": {
                    "type": "JSXIdentifier",
                    "name": "Bar",
                    "loc": null,
                    "range": [
                      142,
                      145
                    ]
                  },
                  "attributes": [],
                  "selfClosing": false,
                  "loc": null,
                  "range": [
                    141,
                    146
                  ]
                },
                "children": [],
                "closingElement": {
                  "type": "JSXClosingElement",
                  "name": {
                    "type": "JSXIdentifier",
                    "name": "Bar",
                    "loc": null,
                    "range": [
                      148,
                      151
                    ]
                  },
                  "loc": null,
                  "range": [
                    146,
                    152
                  ]
                },
                "loc": null,
                "range": [
                  141,
                  152
                ]
              },
              {
                "type": "JSXText",
                "value": "\n    ",
                "raw": "\n    ",
                "loc": null,
                "range": [
                  152,
                  157
                ]
              },
              {
                "type": "JSXElement",
                "openingElement": {
                  "type": "JSXOpeningElement",
                  "name": {
                    "type": "JSXIdentifier",
                    "name": "ErrorView",
                    "loc": null,
                    "range": [
                      158,
                      167
                    ]
                  },
                  "attributes": [],
                  "selfClosing": false,
                  "loc": null,
                  "range": [
                    157,
                    168
                  ]
                },
                "children": [],
                "closingElement": {
                  "type": "JSXClosingElement",
                  "name": {
                    "type": "JSXIdentifier",
                    "name": "ErrorView",
                    "loc": null,
                    "range": [
                      170,
                      179
                    ]
                  },
                  "loc": null,
                  "range": [
                    168,
                    180
                  ]
                },
                "loc": null,
                "range": [
                  157,
                  180
                ]
              },
              {
                "type": "JSXText",
                "value": "\n  ",
                "raw": "\n  ",
                "loc": null,
                "range": [
                  180,
                  183
                ]
              }
            ],
            "closingElement": {
              "type": "JSXClosingElement",
              "name": {
                "type": "JSXIdentifier",
                "name": "Foo",
                "loc": null,
                "range": [
                  185,
                  188
                ]
              },
              "loc": null,
              "range": [
                183,
                189
              ]
            },
            "loc": null,
            "range": [
              131,
              189
            ]
          },
          "generator": true,
          "async": false,
          "loc": null,
          "range": [
            116,
            191
          ],
          "expression": true,
          "loc": null,
          "range": [
            116,
            191
          ]
        },
        "loc": null,
        "range": [
          105,
          191
        ]
      },
      "loc": null,
      "range": [
        90,
        192
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    11,
    192
  ]
}
