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.12.16 lib/react/children.rb
isomorfeus-react-16.12.15 lib/react/children.rb
isomorfeus-react-16.12.14 lib/react/children.rb
isomorfeus-react-16.12.13 lib/react/children.rb
isomorfeus-react-16.12.12 lib/react/children.rb
isomorfeus-react-16.12.11 lib/react/children.rb
isomorfeus-react-16.12.10 lib/react/children.rb
isomorfeus-react-16.12.9 lib/react/children.rb
isomorfeus-react-16.12.8 lib/react/children.rb
isomorfeus-react-16.12.7 lib/react/children.rb
isomorfeus-react-16.12.6 lib/react/children.rb
isomorfeus-react-16.12.5 lib/react/children.rb
isomorfeus-react-16.12.4 lib/react/children.rb
isomorfeus-react-16.12.3 lib/react/children.rb
isomorfeus-react-16.12.2 lib/react/children.rb
isomorfeus-react-16.12.1 lib/react/children.rb
isomorfeus-react-16.12.0 lib/react/children.rb
isomorfeus-react-16.11.4 lib/react/children.rb
isomorfeus-react-16.11.3 lib/react/children.rb
isomorfeus-react-16.11.2 lib/react/children.rb