Skip to content

Commit 86f8bfb

Browse files
Enhance documentation to clarify that promise options are exclusive to React on Rails Pro with the Node renderer
1 parent b2ebbbf commit 86f8bfb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/javascript/render-functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ const MyComponent = (props, _railsContext) => {
7676

7777
### 4. Promises of Strings
7878

79+
This and other promise options below are only available in React on Rails Pro with the Node renderer.
80+
7981
```jsx
8082
const MyComponent = async (props, _railsContext) => {
8183
const data = await fetchData();

node_package/src/serverRenderReactComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function processPromise(
6262
): RenderStateHtml {
6363
if (!renderingReturnsPromises) {
6464
console.error(
65-
'Your render function returned a Promise, which is only supported by a node renderer, not ExecJS.',
65+
'Your render function returned a Promise, which is only supported by the React on Rails Pro Node renderer, not ExecJS.',
6666
);
6767
// If the app is using server rendering with ExecJS, then the promise will not be awaited.
6868
// And when a promise is passed to JSON.stringify, it will be converted to '{}'.

0 commit comments

Comments
 (0)