{"id":6487,"date":"2014-04-18T07:06:51","date_gmt":"2014-04-18T07:06:51","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/problem-about-reactjs-collection-of-common-programming-errors\/"},"modified":"2014-04-18T07:06:51","modified_gmt":"2014-04-18T07:06:51","slug":"problem-about-reactjs-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/problem-about-reactjs-collection-of-common-programming-errors\/","title":{"rendered":"problem about reactjs-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/142dbbce38e59d6b5e452ca6fcf725ef?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAndrew<br \/>\njavascript reactjs<br \/>\nI&#8217;m trying to create a simple grid-based editor for a data structure and I&#8217;m having a couple conceptual problems with React.js. Their documentation is not very helpful on this, so I&#8217;m hoping someone here can help. First, what is the correct way to transfer state from an outer component to an inner component? Is it possible to have state changes in the inner component &#8220;bubble up&#8221; to the outer component(s)? Second, can two separate components share data, so that a mutation in one is visible in the<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9ba6150e291caaf45913da5ab8cf8d3e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNVI<br \/>\ntemplate-engine reactjs<br \/>\nI&#8217;m porting the following code from AngularJS to React:&lt;div style=&#8221;translate: translate({x}px, {y}px) scale({scale}) rotate({angle}deg)&#8221;}&gt;&lt;\/div&gt;I tried:&lt;div style=&#8221;translate: translate({this.state.x}px, {this.state.y}px) scale({this.state.scale}) rotate({this.state.angle}deg)&#8221;}&gt;&lt;\/div&gt;It failed with Parse Error: Line X: Unexpected token }.The best I came up with is:&lt;div style={{transform: &#8220;translate(&#8221; + this.state.x + &#8220;px, &#8221; + this.state.y + &#8220;px) \\scale(&#8221; + this.state.s<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a95f0a2f51eb883490aa4135fe77bff6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsam<br \/>\nreactjs<br \/>\ni am just starting with Reactjs and was writing a simple component to display li tag and came across this error Unexpected token &#8216;&lt;&#8216;I have put the example at jsbin below http:\/\/jsbin.com\/UWOquRA\/1\/edit?html,js,console,outputPlease let me know what i am doing wrong.Thanks in advance<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c2e6cda6392b53430f9dad460c0a565c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDjangoRocks<br \/>\nfacebook reactjs<br \/>\nI am tryin out Facebook&#8217;s Reactjs library and found it awesome. I have ran through the exampe\/tutorial and got it working.Now i am at : http:\/\/facebook.github.io\/react\/docs\/interactivity-and-dynamic-uis.html And I am trying out the code:\/** @jsx React.DOM *\/var LikeButton = React.createClass({getInitialState: function() {return {liked: false};},handleClick: function(event) {this.setState({liked: !this.state.liked});},render: function() {var text = this.state.liked ? &#8216;like&#8217; : &#8216;unlike&#8217;;return (&lt;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4cbfcdd51d0ec56844b3540f62d06af3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njohn mangual<br \/>\njavascript facebook markdown frontend reactjs<br \/>\nGoing along Facebook&#8217;s read.js tutorial, I get this error:Uncaught TypeError: Property &#8216;CommentList&#8217; of object [object Object] is not a functionIn fact react.js&#8217;s own examples page has:Uncaught TypeError: object is not a functionCan anyone explain the correct usage?My progress in TutorialImport the following two javascripts:http:\/\/fb.me\/react-0.4.1.js http:\/\/fb.me\/JSXTransformer-0.4.1.jsThe HTML is one line:&lt;div id=&#8221;content&#8221;&gt;&lt;\/div&gt;And the javascript or rather &lt;script type=&#8221;text\/js<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fe638a46efe97afc9c9dd039de54fb6b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nryanwebjackson<br \/>\njavascript javascript-library reactjs<br \/>\nI recently learned about Facebook\/Instagram&#8217;s app framework for JavaScript called &#8220;React&#8221; and wanted to look more into it. However, I found myself getting conflicting search results, as there is another library of a similar name. So, my question is this: Are there similarities between the two, or could someone do a better job at naming?React http:\/\/facebook.github.io\/react\/index.htmlreact.js http:\/\/www.reactjs.com\/<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Andrew javascript reactjs I&#8217;m trying to create a simple grid-based editor for a data structure and I&#8217;m having a couple conceptual problems with React.js. Their documentation is not very helpful on this, so I&#8217;m hoping someone here can help. First, what is the correct way to transfer state from an outer component to an inner [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6487","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6487"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6487\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}