Fix default layout handling for render component#1418
Fix default layout handling for render component#1418
Conversation
PR Review: Fix default layout handling for render componentThis is a well-scoped fix for #1356. The logic is correct and the test coverage is solid. A few observations below. Core logic (
|
Code ReviewOverall, this is a clean, well-scoped fix for the Rails 8 layout regression. The approach is correct and the test coverage is solid. A few notes below.
|
| Area | Status |
|---|---|
| Bug fix correctness | ✅ Correct — key? guard handles layout: false properly |
| Unit test coverage | ✅ Good — all three option combinations tested |
| Integration test coverage | ✅ Good — could add named layout case |
| Assertion precision | assert_equal over truthiness checks |
| Changelog format | |
| Security / performance | ✅ No concerns |
The fix is sound and ready to merge once the minor items above are addressed (or consciously left as-is).
Summary
render component:when no explicitlayout:option is passedlayout: falserender :component#1356Closes #1356.
Testing
mise exec ruby@3.2.9 -- env BUNDLE_PATH=/Users/justin/codex/react-rails/repo/vendor/bundle bundle exec ruby -Itest test/react/rails/railtie_test.rbmise exec ruby@3.2.9 -- env BUNDLE_PATH=/Users/justin/codex/react-rails/repo/vendor/bundle bundle exec ruby -Itest test/react/rails/component_renderer_test.rbmise exec ruby@3.2.9 -- env BUNDLE_GEMFILE=/Users/justin/codex/react-rails/issue-1356/LintingGemfile BUNDLE_PATH=/Users/justin/codex/react-rails/issue-1356/vendor/bundle bundle exec rubocop lib/react/rails/railtie.rb test/react/rails/railtie_test.rb test/react/rails/component_renderer_test.rb