Skip to content

Commit 1e7f963

Browse files
justin808claude
andauthored
RBS: Narrow type signatures for props parameters (#1966)
## Summary Improves type precision for props parameters in RBS signatures by changing from `untyped` to `Hash[Symbol, untyped] | String`. ## Changes - **helper.rbs**: Updated `sanitized_props_string` props parameter type - **controller.rbs**: Updated `redux_store` props parameter type ## Benefits - More precise type checking for props parameters - Accepts both common formats (Hash or JSON string) - Better IDE support and autocomplete - Catches type errors earlier ## Testing - ✅ `bundle exec rubocop` passes with no violations - ✅ Pre-commit hooks pass (formatting, linting, trailing newlines) Fixes #1951 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/1966) <!-- Reviewable:end --> Co-authored-by: Claude <[email protected]>
1 parent d94259f commit 1e7f963

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sig/react_on_rails/controller.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module ReactOnRails
55

66
def redux_store: (
77
String store_name,
8-
?props: untyped,
8+
?props: Hash[Symbol, untyped] | String,
99
?immediate_hydration: bool
1010
) -> void
1111

sig/react_on_rails/helper.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module ReactOnRails
2121
# Returns html_safe string (ActiveSupport::SafeBuffer)
2222
def redux_store: (
2323
String store_name,
24-
?Hash[Symbol, untyped] props
24+
?Hash[Symbol, untyped] | String props
2525
) -> safe_buffer
2626

2727
# Returns html_safe string (ActiveSupport::SafeBuffer)
@@ -33,7 +33,7 @@ module ReactOnRails
3333
?Hash[Symbol, untyped] options
3434
) -> safe_buffer
3535

36-
def sanitized_props_string: (untyped props) -> String
36+
def sanitized_props_string: (Hash[Symbol, untyped] | String props) -> String
3737

3838
def rails_context: (
3939
?server_side: bool

0 commit comments

Comments
 (0)