react-rails 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e6c53ba3d29462804973f19b4e07ad1dda5bedb
4
- data.tar.gz: d6e06f1f5e964a406362a56a0ad9e9d6ee4c6c7f
3
+ metadata.gz: 3b0add932e37ac43fea18b43d735f629beddd7fa
4
+ data.tar.gz: 23b384f84760fd7c3e6acaa544f8bba42225c681
5
5
  SHA512:
6
- metadata.gz: e7ca70e535d329bd3067c2ea242d71631b4d7fb9573832ef69915bd2f17706b4fb55eae429d10910d5c373fde6e190b6451ec56b9d0afb94cd9cd41f6a0d2689
7
- data.tar.gz: bad31f47872e3c1fb589b56e44c8cb758447d9db3d01a4acc069f2b020864e53f06e889057d966f71ca2cc66cd37e54f6b7612555147aa012ec0dd5f638f64b4
6
+ metadata.gz: 5f4838f09a9be35626d8e9dc0b3b0dda3154946a4734197f364f17c6ca2ab614030197360565cf735f6e7e150eeed37fa257237fcd4a98413d5529395c1695dc
7
+ data.tar.gz: a5df10dca7daa874f0afef8426e7f947d633b4ae248d684e2663ae33034142c6462b24600e7b84c9657625232c0b051d0f130d65308f35be94bb6a0e515a829d
@@ -66,7 +66,9 @@
66
66
  for (var i = 0; i < nodes.length; ++i) {
67
67
  var node = nodes[i];
68
68
 
69
- React.unmountComponentAtNode(node);
69
+ // Prefer ReactDOM if defined (introduced in 0.14)
70
+ var renderer = (typeof ReactDOM == "object") ? ReactDOM : React;
71
+ renderer.unmountComponentAtNode(node);
70
72
  }
71
73
  }
72
74
  };
@@ -1,6 +1,6 @@
1
1
  module React
2
2
  module Rails
3
3
  # If you change this, make sure to update VERSIONS.md
4
- VERSION = '1.3.2'
4
+ VERSION = '1.3.3'
5
5
  end
6
6
  end
@@ -9,8 +9,15 @@ module React
9
9
  # The default is {React::Rails::ComponentMount}
10
10
  mattr_accessor :helper_implementation_class
11
11
 
12
+ # Render a React component into the view
13
+ # using the {helper_implementation_class}
14
+ #
15
+ # If called during a Rails controller-managed request, use the instance
16
+ # created by the controller.
17
+ #
18
+ # Otherwise, make a new instance.
12
19
  def react_component(*args, &block)
13
- helper_obj = @__react_component_helper
20
+ helper_obj = @__react_component_helper ||= helper_implementation_class.new
14
21
  helper_obj.react_component(*args, &block)
15
22
  end
16
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul O’Shannessy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-13 00:00:00.000000000 Z
11
+ date: 2015-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal