---
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/useMemo-simple.js
---
Input:
function component(a) {
  let x = useMemo(() => [a], [a]);
  return <Foo x={x}></Foo>;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "component",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          18
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "a",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            19,
            20
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    30,
                    31
                  ]
                },
                "init": {
                  "type": "CallExpression",
                  "callee": {
                    "type": "Identifier",
                    "name": "useMemo",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      34,
                      41
                    ]
                  },
                  "arguments": [
                    {
                      "type": "ArrowFunctionExpression",
                      "id": null,
                      "params": [],
                      "body": {
                        "type": "ArrayExpression",
                        "elements": [
                          {
                            "type": "Identifier",
                            "name": "a",
                            "typeAnnotation": null,
                            "loc": null,
                            "range": [
                              49,
                              50
                            ]
                          }
                        ],
                        "loc": null,
                        "range": [
                          48,
                          51
                        ]
                      },
                      "generator": true,
                      "async": false,
                      "loc": null,
                      "range": [
                        42,
                        51
                      ],
                      "expression": true,
                      "loc": null,
                      "range": [
                        42,
                        51
                      ]
                    },
                    {
                      "type": "ArrayExpression",
                      "elements": [
                        {
                          "type": "Identifier",
                          "name": "a",
                          "typeAnnotation": null,
                          "loc": null,
                          "range": [
                            54,
                            55
                          ]
                        }
                      ],
                      "loc": null,
                      "range": [
                        53,
                        56
                      ]
                    }
                  ],
                  "loc": null,
                  "range": [
                    34,
                    57
                  ]
                },
                "loc": null,
                "range": [
                  30,
                  57
                ]
              }
            ],
            "loc": null,
            "range": [
              26,
              58
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "JSXElement",
              "openingElement": {
                "type": "JSXOpeningElement",
                "name": {
                  "type": "JSXIdentifier",
                  "name": "Foo",
                  "loc": null,
                  "range": [
                    69,
                    72
                  ]
                },
                "attributes": [
                  {
                    "type": "JSXAttribute",
                    "name": {
                      "type": "JSXIdentifier",
                      "name": "x",
                      "loc": null,
                      "range": [
                        73,
                        74
                      ]
                    },
                    "value": {
                      "type": "JSXExpressionContainer",
                      "expression": {
                        "type": "Identifier",
                        "name": "x",
                        "typeAnnotation": null,
                        "loc": null,
                        "range": [
                          76,
                          77
                        ]
                      },
                      "loc": null,
                      "range": [
                        75,
                        78
                      ]
                    },
                    "loc": null,
                    "range": [
                      73,
                      78
                    ]
                  }
                ],
                "selfClosing": false,
                "loc": null,
                "range": [
                  68,
                  79
                ]
              },
              "children": [],
              "closingElement": {
                "type": "JSXClosingElement",
                "name": {
                  "type": "JSXIdentifier",
                  "name": "Foo",
                  "loc": null,
                  "range": [
                    81,
                    84
                  ]
                },
                "loc": null,
                "range": [
                  79,
                  85
                ]
              },
              "loc": null,
              "range": [
                68,
                85
              ]
            },
            "loc": null,
            "range": [
              61,
              86
            ]
          }
        ],
        "loc": null,
        "range": [
          22,
          88
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        88
      ],
      "loc": null,
      "range": [
        0,
        88
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    88
  ]
}
