diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cbaf04a6..3c8c6ca02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ Changes since last non-beta release. *Please add entries here for your pull requests that are not yet released.* ### [11.3.0] - 2019-04-20 #### Added +- Added method for retrieving any option from `render_options` [PR 1213](https://github.com/shakacode/react_on_rails/pull/1213) +by [ashgaliyev](https://github.com/ashgaliyev). + - html_options can now has option for 'tag' to add dynamically html element. like this: `html_options: { tag: "span" }`. [PR 1208](https://github.com/shakacode/react_on_rails/pull/1208) by [tahsin352](https://github.com/tahsin352). diff --git a/lib/react_on_rails/react_component/render_options.rb b/lib/react_on_rails/react_component/render_options.rb index 35ae0539f..a666722ef 100644 --- a/lib/react_on_rails/react_component/render_options.rb +++ b/lib/react_on_rails/react_component/render_options.rb @@ -72,6 +72,10 @@ def to_s "{ react_component_name = #{react_component_name}, options = #{options}, request_digest = #{request_digest}" end + def internal_option(key) + options[key] + end + private attr_reader :options