<commit_before>module Intercode
  module Liquid
    module Tags
      # @api
      module AppComponentRenderer
        include ActionView::Helpers::TagHelper

        def render_react_component(context)
          content_tag(
            :div,
            '',
            'data-react-class' => component_name(context),
            'data-react-props' => JSON.dump(
              context.registers['controller'].app_component_props
                .merge(props(context))
            )<commit_msg>Make it work in previews<commit_after>module Intercode
  module Liquid
    module Tags
      # @api
      module AppComponentRenderer
        include ActionView::Helpers::TagHelper

        def render_react_component(context)
          controller_props = context.registers['controller']&.app_component_props

          content_tag(
            :div,
            '',
            'data-react-class' => component_name(context),
            'data-react-props' => JSON.dump((controller_props || {}).merge(props(context)))
{'fraction_non_alphanumeric': 0.09900990099009901, 'fraction_numerical': 0.0, 'mean_word_length': 2.2403846153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3515886', 'n_tokens_mistral': 262, 'n_tokens_neox': 258, 'n_words': 47}