Skip to content

Commit b772d16

Browse files
aspeddrocristianoc
authored andcommitted
add deprecated note unsafe string interpolation
1 parent b7acc4f commit b772d16

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pages/docs/manual/latest/primitive-types.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ var greeting = "Hello\nWorld\n👋\n" + name + "\n";
7171

7272
This is just like JavaScript's backtick string interpolation, except without needing to escape special characters.
7373

74+
### Unsafe String Interpolation (Deprecated)
75+
76+
> ReScript v10.1.4 deprecated unsafe string interpolation and will be removed in v11.
77+
7478
For interpolation, you'll have to convert the binding (`name` in the example) into a string if it isn't one. If you want the interpolation to implicitly convert a binding into a string, prepend a `j`:
7579

7680
<CodeTab labels={["ReScript", "JS Output"]}>
@@ -180,4 +184,4 @@ The `unknown` type represents values with contents that are a mystery or are not
180184

181185
The ReScript type system helps you avoid run-time crashes and unpredicatable behavior by preventing you from using `unknown` in places that expect a `string` or `int` or some other type. The ReScript core libraries also provide utility functions to help you inspect `unknown` values and access their contents. In some cases you may need a JSON parsing library to convert `unknown` values to types you can safely use.
182186

183-
Consider using `unknown` when receiving data from [external JavaScript functions](/docs/manual/latest/bind-to-js-function)
187+
Consider using `unknown` when receiving data from [external JavaScript functions](/docs/manual/latest/bind-to-js-function)

0 commit comments

Comments
 (0)