From 610fdd3722ddde839de2c0bd538b137540c30aab Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sun, 9 Nov 2025 17:41:16 -1000 Subject: [PATCH] RBS: Narrow type signatures for props parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve type precision for props parameters in RBS signatures by changing from `untyped` to `Hash[Symbol, untyped] | String`. This change: - Provides better type checking for props parameters - Accepts both common formats (Hash or JSON string) - Improves IDE support and autocomplete - Helps catch type errors earlier Updated signatures: - helper.rbs: sanitized_props_string props parameter - controller.rbs: redux_store props parameter Fixes #1951 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- sig/react_on_rails/controller.rbs | 2 +- sig/react_on_rails/helper.rbs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sig/react_on_rails/controller.rbs b/sig/react_on_rails/controller.rbs index a238284df6..39c8190f26 100644 --- a/sig/react_on_rails/controller.rbs +++ b/sig/react_on_rails/controller.rbs @@ -5,7 +5,7 @@ module ReactOnRails def redux_store: ( String store_name, - ?props: untyped, + ?props: Hash[Symbol, untyped] | String, ?immediate_hydration: bool ) -> void diff --git a/sig/react_on_rails/helper.rbs b/sig/react_on_rails/helper.rbs index dcc356b968..271666eb6a 100644 --- a/sig/react_on_rails/helper.rbs +++ b/sig/react_on_rails/helper.rbs @@ -21,7 +21,7 @@ module ReactOnRails # Returns html_safe string (ActiveSupport::SafeBuffer) def redux_store: ( String store_name, - ?Hash[Symbol, untyped] props + ?Hash[Symbol, untyped] | String props ) -> safe_buffer # Returns html_safe string (ActiveSupport::SafeBuffer) @@ -33,7 +33,7 @@ module ReactOnRails ?Hash[Symbol, untyped] options ) -> safe_buffer - def sanitized_props_string: (untyped props) -> String + def sanitized_props_string: (Hash[Symbol, untyped] | String props) -> String def rails_context: ( ?server_side: bool