{"id":21108,"date":"2018-03-09T12:15:50","date_gmt":"2018-03-09T10:15:50","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=21108"},"modified":"2018-03-09T11:05:57","modified_gmt":"2018-03-09T09:05:57","slug":"angular-1-to-react-migration","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/","title":{"rendered":"Angular 1 to React Migration"},"content":{"rendered":"<p>Recently I decided to migrate one of my side projects to React. I had several reasons for that, but the most important is that, obviously, Angular 1 is old, and nobody cares about it anymore. No community, no bugfixes, no improvements. It is basically dead.<\/p>\n<p>So I decided to give React a go. And you know what? I was blown away by how easy it was to rewrite my whole application from Angular 1 to React. It took just a couple of weekends, impressive given that my application is rather complex with several dozen related and interdependent components.<\/p>\n<p>In this article, I\u2019m going to share my impressions and will describe the transition I had to undergo to think in React.<\/p>\n<h2>Overview and Comparison<\/h2>\n<p>Here\u2019s the TL;DR:<\/p>\n<ul>\n<li>React is a small view library, but you still need to learn a lot to create a basic application.<\/li>\n<li>Prepare to write more code, but bonus, it should be more straightforward.<\/li>\n<li>More JavaScript-ish. Less mental overhead.<\/li>\n<li>One-way data flow is verbose in practice, but more direct and easy to reason about.<\/li>\n<li>JSX is not that bad. It\u2019s more lintable, so it\u2019s easier to spot errors.<\/li>\n<li>You have to use classes for stateful components. But please don\u2019t use inheritance.<\/li>\n<li>In React, you always want to have less state to manage, so you should prefer function components to class components.<\/li>\n<\/ul>\n<h3>Ecosystem<\/h3>\n<p>Usually, people say that React is simple because it\u2019s just a rendering library, which is true (one can easily walk through the <a href=\"https:\/\/reactjs.org\/docs\/hello-world.html\">entire documentation<\/a> in several hours), but that doesn\u2019t mean it\u2019s easy to create a new project with it. And that\u2019s because React itself is not sufficient for a complete application. You will need to learn things outside the React library but within the React ecosystem.<\/p>\n<p>As soon as you start making React applications, your first questions will probably be:<\/p>\n<ul>\n<li>How do I fetch the data?<\/li>\n<li>How do I describe routes?<\/li>\n<li>How do I manage state?<\/li>\n<li>How do I interact with API?<\/li>\n<\/ul>\n<p>There are of course multiple answers to all those questions. But you need to understand that React won\u2019t answer them. Those are the decisions you\u2019re going to have to make on your own.<\/p>\n<h3>Verboseness<\/h3>\n<p>After moving from Angular 1 to React, the next thing you\u2019ll notice is that you have to write more code. In my experience, it\u2019s around two times more typing. It\u2019s frustrating, but after some time you get used to it. In general, there\u2019s a tradeoff between verboseness and clarity \u2014 React is more verbose, but as an upside, the code is more readable.<\/p>\n<p>In practice, however, I would say, it\u2019s perfectly possible to write readable and maintainable Angular 1 code just as, vice versa, it\u2019s possible to write terrible and convoluted React code. So I guess it boils down to your personal style.<\/p>\n<p>React concepts that increase verboseness are JSX and one-way data flow, but we\u2019ll talk more on those later.<\/p>\n<h3>React is more JavaScript-ish<\/h3>\n<p>Every time you learn a new framework, there\u2019s an overhead of what you need to learn. Those are things that lie in your brain and make you productive within a particular framework but are useless when you switch to another thing. React is more down-to-earth than anything else I\u2019ve used before. Whatever you do, just write JavaScript, even when you write templates. But more on this in the next part.<\/p>\n<h3>JSX<\/h3>\n<p>When people encounter <a href=\"https:\/\/reactjs.org\/docs\/introducing-jsx.html\">JSX<\/a>, they often complain about violation of separation concern. You write JavaScript code and HTML-like markup in the same file, and that scares people off. In reality, though, it\u2019s not a violation if you put them in one file. It\u2019s a violation when you mix up logic with a view, but that\u2019s totally avoidable.<\/p>\n<p>Constructions like <code>if<\/code> and <code>for<\/code> within your markup have nothing to do with separation of concerns.<\/p>\n<p>We do the same thing in Angular with <code>ng-if<\/code> and <code>ng-each<\/code>. But in React, the code is not artificial \u2014 that\u2019s just markup + JavaScript. Since it\u2019s a superset of JavaScript, it\u2019s perfectly lintable, so you will know you\u2019re missing a method at the linting time. In the case of Angular, it will silently fail even at runtime (because templates in Angular are just strings).<\/p>\n<p>This one was a game changer for me.<\/p>\n<p>On the negative side of things, it\u2019s good to understand that JSX is not exactly HTML + JavaScript. There\u2019s still stuff that is React-specific; for example, you have to write all the properties in camel case, and you can\u2019t use <code>class<\/code>. Instead, you have to write <code>className<\/code>.<\/p>\n<p>Oh, and you also can\u2019t use strings for styles. Instead you write something like this: <code>style={{ marginTop: '5px' }}<\/code>. All this means you can\u2019t just take a piece of your HTML markup and use it as React template \u2014 you still need to adjust.<\/p>\n<h3>One-way data flow<\/h3>\n<p>Okay, moving forward to one of React\u2019s key selling points: the data flow. In React, it always goes from the parent to children. What if a child component needs to update the state? In that case, it should communicate to its parent via a callback. The parent will update the state, and so the data will pass down to the child again, causing the rerender (the virtual one).<\/p>\n<p>In practice, this does lead to a more understandable stream-lined data flow. As a downside, you again have to tolerate the mental overhead. Imagine you have a tree of components, and something changed at the very bottom of that tree. To propagate the change to the top components, you have to pass a callback all the way down through all the levels of the tree. It is cumbersome, but state managers like <a href=\"https:\/\/github.com\/mobxjs\/mobx\">Mobx<\/a> or <a href=\"https:\/\/redux.js.org\/\">Redux<\/a> help to deal with that. However, they can add more overhead.<\/p>\n<h3>Classes<\/h3>\n<p>So I couldn\u2019t avoid this aspect. I still think that classes are weird out-of-the-place creatures that shouldn\u2019t have made it to JavaScript. I imagine they were introduced to make Java folks feel at home. Underneath, nothing changed \u2014 that\u2019s still a good old prototype-based inheritance. <code>class<\/code> is just syntactic sugar that attempts to hide the nature of the JavaScript, and it fails to do that.<\/p>\n<p>Class-based programming in JavaScript is complex, hard, and convoluted. As opposed to functional programming, that may be a bit wordy first, but in the end, it scales so much better. Even in React docs they <a href=\"https:\/\/reactjs.org\/docs\/composition-vs-inheritance.html\">warn against using inheritance<\/a> with classes.<\/p>\n<p>But well, whatever I say, you can\u2019t change the fact that React API use classes. If you\u2019re using a stateless component, you should use a pure function. Whereas if you have state, you need to use classes instead. And as a React developer, your job is to try to localize the state, which means using pure stateless components (functions) as much as possible and use clauses as little as possible.<\/p>\n<p>To dive deeper into that topic, read <a href=\"https:\/\/medium.com\/@dan_abramov\/how-to-use-classes-and-sleep-at-night-9af8de78ccb4\">this writeup<\/a> by Dan Abramov.<\/p>\n<h2>Real-world Examples<\/h2>\n<p>Now on to the fun part. Let\u2019s see several examples of how you might migrate an Angular 1 component to React.<\/p>\n<h3>Stateless component<\/h3>\n<p>Let\u2019s assume we have a component that displays a single user\u2019s info. In Angular 1, it could look something like this:<\/p>\n<pre class=\"brush:php\">const TMPLT = `\r\n&lt;div class=\"item clearfix\"&gt;\r\n  &lt;div class=\"ava\"&gt;\r\n    &lt;img ng-src=\"{{user.avatar}}\" \/&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div&gt;\r\n    &lt;div class=\"name\"&gt;\r\n      &lt;a href=\"\/users\/{{user.id}}\/\"&gt;{{ user.name }}&lt;\/a&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class=\"phone\"&gt; {{ user.phone }} &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n`;\r\nexport default function() {\r\n  return {\r\n    restrict: 'E',\r\n    scope: {\r\n      user: '='\r\n    },\r\n    template: TMPL\r\n  }\r\n}<\/pre>\n<p>Note that nasty <code>user: '='<\/code> thing. That\u2019s a two-way data-binding, meaning you can change it in the component and it will change in the parent as well, and vice versa. That\u2019s something you can\u2019t have in React.<\/p>\n<p>Rewriting it in React turns out to be really easy; all you have to do is to create a pure function. That function accepts properties and returns a JSX markup that needs be rendered.<\/p>\n<pre class=\"brush:php\">export default function({ user: { name, phone, avatar } }) {\r\n  return (\r\n    &lt;div className=\"item clearfix\"&gt;\r\n      &lt;div className=\"ava pull-left\"&gt;\r\n        &lt;img src={avatar} \/&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div className=\"name pull-right\"&gt;\r\n        &lt;div className=\"name\"&gt;\r\n          &lt;a href={`\/users\/${user.id}`}&gt;{ name }&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div className=\"phone\"&gt;{ phone } &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  )\r\n}<\/pre>\n<p>Note that:<\/p>\n<ul>\n<li>We removed the Angular-specific attributes (<code>ng-src<\/code>) and added some React-specific ones (<code>className<\/code>).<\/li>\n<li>Everything inside <code>{}<\/code> is just a JavaScript code, not some artificial mini-language.<\/li>\n<li>In this specific example, it actually became less code.<\/li>\n<\/ul>\n<h3>Introducing state<\/h3>\n<p>Now let\u2019s see how would you implement an address book component (to display a single user, we\u2019ll reuse a component from the previous section).<\/p>\n<p><strong>Angular 1:<\/strong><\/p>\n<pre class=\"brush:php\">const TMPL = `\r\n  &lt;div class=\"address-book\"&gt;\r\n    &lt;user user=\"u\" ng-for=\"u in users\"&gt;&lt;\/user&gt;\r\n  &lt;\/div&gt;\r\n`\r\n\r\nexport default function() {\r\n  return {\r\n    restrict: 'E',\r\n    scope: { },\r\n    template: TMPL,\r\n    link\r\n  }\r\n\r\n  function link($scope) {\r\n    fetchUsers().then((users) =&gt; {\r\n      $scope.users = users;\r\n    })\r\n  }\r\n}<\/pre>\n<p>We\u2019re not interested in how <code>fetchUsers<\/code> might be implemented, but in the case of Angular, you\u2019d probably use a <code>$http<\/code> service to send AJAX request, since it\u2019s part of the API.<\/p>\n<p><strong>React:<\/strong><\/p>\n<pre class=\"brush:php\">class AddressBook {\r\n  constructor(props) {\r\n    super(props) \/\/ always invoke super\r\n    this.state = {\r\n      users: [] \/\/ default state\r\n    }\r\n  }\r\n\r\n  componentDidMount() {\r\n    \/\/ gets invoked after component \r\n    fetchUsers().then((users) =&gt; {\r\n      this.setState({ users })\r\n    })\r\n  }\r\n\r\n  render() {\r\n    const { users } = this.state\r\n    return (\r\n      &lt;div class=\"address-book\"&gt;\r\n        {\r\n          users.map(u =&gt; &lt;user user={u}&gt;&lt;\/user&gt;)\r\n        }\r\n      &lt;\/div&gt;\r\n    )\r\n  }\r\n}<\/pre>\n<p>Note that:<\/p>\n<ul>\n<li>We had to utilize classes here. In React, every component that has state needs to be a class. It has a <code>componentDidMount<\/code> method, which is <a href=\"https:\/\/reactjs.org\/docs\/state-and-lifecycle.html\">a lifecycle hook<\/a>, and it\u2019s being invoked after component rendered into the DOM.<\/li>\n<li>Instead of <code>ng-for<\/code>, we\u2019re now using a plain JavaScript to render a list, which is very nice.<\/li>\n<li>Instead of directly setting state, we have to use <code>setState<\/code> method. Otherwise React will never know that the state has changed and it needs to rerender.<\/li>\n<\/ul>\n<h3>Propagating the state<\/h3>\n<p>Let\u2019s have some fun now. Suppose that for every contact we have an editable field, say, a phone number. In Angular, we will use <code>ng-model<\/code> for that.<\/p>\n<pre class=\"brush:php\">const TMPLT = `\r\n&lt;div class=\"item clearfix\"&gt;\r\n  &lt;div class=\"ava\"&gt;\r\n    &lt;img ng-src=\"{{user.avatar}}\" \/&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div&gt;\r\n    &lt;div class=\"name\"&gt;\r\n      &lt;a href=\"\/users\/{{user.id}}\/\"&gt;{{ user.name }}&lt;\/a&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div class=\"phone\"&gt;\r\n      &lt;input type=\"text\" ng-model=\"user.phone\" \/&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>Nothing else is changed. Since we have a 2-way binding, when we change the phone, it automatically propagates to the parent array of users, and that\u2019s it. With React though, we need to implement the propagation ourselves.<\/p>\n<pre class=\"brush:php\">export default function({ user: { id, name, phone, avatar } }, onChange) {\r\n  return (\r\n    &lt;div className=\"item clearfix\"&gt;\r\n      &lt;div className=\"ava pull-left\"&gt;\r\n        &lt;img src={avatar} \/&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div className=\"pull-right\"&gt;\r\n        &lt;div className=\"name\"&gt;\r\n          &lt;a href={`\/users\/${id}`}&gt;{ name }&lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div className=\"phone\"&gt;\r\n          &lt;input type=\"text\"\r\n            value={phone}\r\n            onChange={changed}\r\n          \/&gt;\r\n        &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  )\r\n\r\n  function changed({ target: { value } }) {\r\n    onChange({ id, name, avatar, phone: value })\r\n  }\r\n}<\/pre>\n<p>Note that:<\/p>\n<ul>\n<li>We need to manually sync the state between <code>input<\/code> and the inner state of the application.<\/li>\n<li>When the change happens, we need to pass the updated user model to the parent, by invoking the callback.<\/li>\n<li>It\u2019s the job of the parent component to take the updated user object and update its state.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>What you have just read is a subjective opinion and more like my personal notes about the experience I had. Yours might be very different, so feel free to share it with me.<\/p>\n<p>And let\u2019s draw a line here:<\/p>\n<ul>\n<li>React is wordier, but that\u2019s okay.<\/li>\n<li>One-way data flow requires some overhead but scales much better.<\/li>\n<li>JSX is a blessing.<\/li>\n<li>You have to deal with classes, but don\u2019t use inheritance, prefer composition.<\/li>\n<li>React is not that scary when you actually try to use it.<\/li>\n<\/ul>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on Web Code Geeks with permission by Yanis Triandaphilov, partner at our <a href=\"\/\/www.webcodegeeks.com\/join-us\/wcg\/\" target=\"_blank\" rel=\"noopener\">WCG program<\/a>. See the original article here: <a href=\"https:\/\/blog.codeship.com\/angular-1-to-react-migration\/\" target=\"_blank\" rel=\"noopener\">Angular 1 to React Migration<\/a><\/p>\n<p>Opinions expressed by Web Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Recently I decided to migrate one of my side projects to React. I had several reasons for that, but the most important is that, obviously, Angular 1 is old, and nobody cares about it anymore. No community, no bugfixes, no improvements. It is basically dead. So I decided to give React a go. And you &hellip;<\/p>\n","protected":false},"author":227,"featured_media":20786,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[511],"tags":[520,468],"class_list":["post-21108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react-js","tag-angular-1","tag-react"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Angular 1 to React Migration - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Recently I decided to migrate one of my side projects to React. I had several reasons for that, but the most important is that, obviously, Angular 1 is\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular 1 to React Migration - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Recently I decided to migrate one of my side projects to React. I had several reasons for that, but the most important is that, obviously, Angular 1 is\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-09T10:15:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yanis Triandaphilov\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yanis Triandaphilov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/\"},\"author\":{\"name\":\"Yanis Triandaphilov\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/556c1e47406608dd65cbdbc1217575c1\"},\"headline\":\"Angular 1 to React Migration\",\"datePublished\":\"2018-03-09T10:15:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/\"},\"wordCount\":1701,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg\",\"keywords\":[\"Angular 1\",\"React\"],\"articleSection\":[\"React.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/\",\"name\":\"Angular 1 to React Migration - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg\",\"datePublished\":\"2018-03-09T10:15:50+00:00\",\"description\":\"Recently I decided to migrate one of my side projects to React. I had several reasons for that, but the most important is that, obviously, Angular 1 is\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"React.js\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/react-js\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Angular 1 to React Migration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/556c1e47406608dd65cbdbc1217575c1\",\"name\":\"Yanis Triandaphilov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7b336d9c2bb6f83299994032828d8717bae760e864c4ddd75f1b02e61ceed860?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7b336d9c2bb6f83299994032828d8717bae760e864c4ddd75f1b02e61ceed860?s=96&d=mm&r=g\",\"caption\":\"Yanis Triandaphilov\"},\"description\":\"Yanis Triandaphilov lives and works in Prague. He's been into Ruby and JavaScript development for more than six years now. \\\"Being not too smart, I struggle for clarity and simplicity in everything I do.\\\"\",\"url\":\"https:\/\/www.webcodegeeks.com\/author\/yanis-triandaphilov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular 1 to React Migration - Web Code Geeks - 2026","description":"Recently I decided to migrate one of my side projects to React. I had several reasons for that, but the most important is that, obviously, Angular 1 is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/","og_locale":"en_US","og_type":"article","og_title":"Angular 1 to React Migration - Web Code Geeks - 2026","og_description":"Recently I decided to migrate one of my side projects to React. I had several reasons for that, but the most important is that, obviously, Angular 1 is","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2018-03-09T10:15:50+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg","type":"image\/jpeg"}],"author":"Yanis Triandaphilov","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Yanis Triandaphilov","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/"},"author":{"name":"Yanis Triandaphilov","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/556c1e47406608dd65cbdbc1217575c1"},"headline":"Angular 1 to React Migration","datePublished":"2018-03-09T10:15:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/"},"wordCount":1701,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg","keywords":["Angular 1","React"],"articleSection":["React.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/","name":"Angular 1 to React Migration - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg","datePublished":"2018-03-09T10:15:50+00:00","description":"Recently I decided to migrate one of my side projects to React. I had several reasons for that, but the most important is that, obviously, Angular 1 is","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2018\/02\/react-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/react-js\/angular-1-to-react-migration\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"React.js","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/react-js\/"},{"@type":"ListItem","position":4,"name":"Angular 1 to React Migration"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/556c1e47406608dd65cbdbc1217575c1","name":"Yanis Triandaphilov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7b336d9c2bb6f83299994032828d8717bae760e864c4ddd75f1b02e61ceed860?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7b336d9c2bb6f83299994032828d8717bae760e864c4ddd75f1b02e61ceed860?s=96&d=mm&r=g","caption":"Yanis Triandaphilov"},"description":"Yanis Triandaphilov lives and works in Prague. He's been into Ruby and JavaScript development for more than six years now. \"Being not too smart, I struggle for clarity and simplicity in everything I do.\"","url":"https:\/\/www.webcodegeeks.com\/author\/yanis-triandaphilov\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/21108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/227"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=21108"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/21108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/20786"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=21108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=21108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=21108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}