Browse Source

Step 2.3: replace starter JS.

Frederic G. MARAND 8 years ago
parent
commit
0046e1a4e3
2 changed files with 6 additions and 23 deletions
  1. 0 23
      simple-todos-react.js
  2. 6 0
      simple-todos-react.jsx

+ 0 - 23
simple-todos-react.js

@@ -1,23 +0,0 @@
-if (Meteor.isClient) {
-  // counter starts at 0
-  Session.setDefault('counter', 0);
-
-  Template.hello.helpers({
-    counter: function () {
-      return Session.get('counter');
-    }
-  });
-
-  Template.hello.events({
-    'click button': function () {
-      // increment the counter when button is clicked
-      Session.set('counter', Session.get('counter') + 1);
-    }
-  });
-}
-
-if (Meteor.isServer) {
-  Meteor.startup(function () {
-    // code to run on server at startup
-  });
-}

+ 6 - 0
simple-todos-react.jsx

@@ -0,0 +1,6 @@
+if (Meteor.isClient) {
+  Meteor.startup(function () {
+    // Use this branch to render the component after the page is ready.
+    ReactDOM.render(<App />, document.getElementById('render-target'));
+  });
+}