-
-
Notifications
You must be signed in to change notification settings - Fork 638
Closed
Labels
Description
Summary
Several RBS type signatures currently use untyped for props parameters, but could be more precise.
Current Signatures
# In sig/react_on_rails/helper.rbs
def react_component: (
String component_name,
?Hash[Symbol, untyped] options
) ?{ () -> untyped } -> safe_buffer
# In sig/react_on_rails/controller.rbs
def redux_store: (
String store_name,
?props: untyped,
?immediate_hydration: bool
) -> voidProposed Improvement
?props: (Hash[Symbol, untyped] | String)Benefits
- More precise type checking
- Still accepts both common formats (Hash or JSON string)
- Better IDE support and autocomplete
- Catches type errors earlier
Related
Follow-up to PR #1945 - post-merge code review feedback
References
lib/react_on_rails/helper.rb- props can be Hash or Stringlib/react_on_rails/controller.rb- similar pattern