Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 2abd065

Browse files
committed
fixed multiple haml classes not working
1 parent 6c88551 commit 2abd065

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/react/element.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def as_node
7979
def method_missing(class_name, args = {}, &new_block)
8080
class_name = class_name.gsub(/__|_/, '__' => '_', '_' => '-')
8181
new_props = properties.dup
82-
new_props[:class] = "\
83-
#{class_name} #{new_props[:class]} #{args.delete(:class)} #{args.delete(:className)}\
82+
new_props[:className] = "\
83+
#{class_name} #{new_props[:className]} #{args.delete(:class)} #{args.delete(:className)}\
8484
".split(' ').uniq.join(' ')
8585
new_props.merge! args
8686
React::RenderingContext.replace(

spec/react/dsl_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ def render
219219
stub_const 'Foo', Class.new(React::Component::Base)
220220
Foo.class_eval do
221221
def render
222-
TestMod123::Bar().the_class
222+
TestMod123::Bar().the_class.other_class
223223
end
224224
end
225225

226-
expect(React.render_to_static_markup(React.create_element(Foo))).to eq('<span class="the-class">a man walks into a bar</span>')
226+
expect(React.render_to_static_markup(React.create_element(Foo))).to eq('<span class="other-class the-class">a man walks into a bar</span>')
227227
end
228228

229229
it "can use the 'class' keyword for classes" do

0 commit comments

Comments
 (0)