Sha256: d027e3a530341050aa83dbf6d451655dd11d059ececdf5ac42317c237ad01641

Contents?: true

Size: 773 Bytes

Versions: 93

Compression:

Stored size: 773 Bytes

Contents

module React
  module Children
    class << self
      def count(children)
        `Opal.global.React.Children.count(children)`
      end

      def for_each(children, &block)
        %x{
          var fun = function(child) {
            #{block.call(child)};
          }
          Opal.global.React.Children.forEach(children, fun);
        }
      end

      def map(children, &block)
        %x{
          var fun = function(child) {
            return #{block.call(child)};
          }
          return Opal.global.React.Children.map(children, fun);
        }
      end

      def only(children)
        `Opal.global.React.Children.only(children)`
      end

      def to_array(children)
        `Opal.global.React.Children.toArray(children)`
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
isomorfeus-react-16.13.11 lib/react/children.rb
isomorfeus-react-16.13.10 lib/react/children.rb
isomorfeus-react-16.13.9 lib/react/children.rb
isomorfeus-react-16.13.8 lib/react/children.rb
isomorfeus-react-16.13.7 lib/react/children.rb
isomorfeus-react-16.13.6 lib/react/children.rb
isomorfeus-react-16.13.5 lib/react/children.rb
isomorfeus-react-16.13.4 lib/react/children.rb
isomorfeus-react-16.13.3 lib/react/children.rb
isomorfeus-react-16.13.2 lib/react/children.rb
isomorfeus-react-16.13.1 lib/react/children.rb
isomorfeus-react-16.13.0 lib/react/children.rb
isomorfeus-react-16.12.24 lib/react/children.rb
isomorfeus-react-16.12.23 lib/react/children.rb
isomorfeus-react-16.12.22 lib/react/children.rb
isomorfeus-react-16.12.21 lib/react/children.rb
isomorfeus-react-16.12.20 lib/react/children.rb
isomorfeus-react-16.12.19 lib/react/children.rb
isomorfeus-react-16.12.18 lib/react/children.rb
isomorfeus-react-16.12.17 lib/react/children.rb