Commit 53921c4
fix: Pass railsContext and guard against async renders in render() method
Fixes a critical regression where the render() method was not passing
railsContext to createReactOutput(), causing render functions that depend
on railsContext (e.g., for location, locale) to receive undefined.
Also adds guards for:
- Server render hash objects (react-router errors)
- Promise returns (async render functions)
These guards ensure the synchronous render() API doesn't silently accept
async operations that should use reactOnRailsComponentLoaded() instead.
Addresses code review comment from PR #1834:
#1834 (comment)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 0b30c04 commit 53921c4
1 file changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
269 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
270 | 295 | | |
271 | 296 | | |
272 | 297 | | |
| |||
0 commit comments