Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions misc_docs/syntax/language_let_invalid.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
id: "let-binding-invalid"
keywords: ["let", "variable"]
name: "let \\\"\""
summary: "This is the `let binding` for invalid identifier names."
category: "languageconstructs"
---

`let \""` is used to bind values to names that are invalid in ReScript, including capitalized names, names with special characters, and reserved keywords.

**Warning: ** This escape hatch is almost exclusively used for interop with JavaScript. If you abuse this, many of the compiler guarantees will go away.

### Example

<CodeTab labels={["ReScript", "JS Output"]}>

```res
let \"ComponentName" = "Header"
let \"min-width" = 640
let \"exception" = true
```

```js
var ComponentName = "Header";
var min$width = 640;
var exception = true;
```

</CodeTab>

### References

* [Use Illegal Identifier Names](/docs/manual/latest/use-illegal-identifier-names)
* [Let binding](/docs/manual/latest/let-binding)
* [Reserved Keywords](/docs/manual/latest/reserved-keywords)