<commit_before>---
title: How to use React with Typescript in Phoenix
date: 2017-07-12
disqus: y
---

Introduction
------------

This is a tutorial on setting up an (Elixir) Phoenix project that can be used to write React apps that use Typescript, a combination of nice things (IMO). Previous tutorials have been written to use [Phoenix with React](https://medium.com/@diamondgfx/phoenix-v1-1-2-and-react-js-3dbd195a880a) or [Typescript with React using Webpack](http://blog.tomduncalf.com/posts/setting-up-typescript-and-react/) but not all 3 together. I ran into a few difficulties while setting it up myself (namely because Phoenix uses Brunch by default rather than Webpack) so here's a guide on how to do it to make things faster for you!

Versions that I've used
-----------------------

**Phoenix**: v1.2.4

**NPM**: v3.10.10

**Brunch**: v2.10.9

**Typescript**: v2.4.1

**React**: v15.6.1
<commit_msg>Add warning that this is not ready<commit_after>---
title: How to use React with Typescript in Phoenix
date: 2017-07-12
disqus: y
---

*this tutorial is a work in progress and you may run into further issues as the project progresses*

Introduction
------------

This is a tutorial on setting up an (Elixir) Phoenix project that can be used to write React apps that use Typescript, a combination of nice things (IMO). Previous tutorials have been written to use [Phoenix with React](https://medium.com/@diamondgfx/phoenix-v1-1-2-and-react-js-3dbd195a880a) or [Typescript with React using Webpack](http://blog.tomduncalf.com/posts/setting-up-typescript-and-react/) but not all 3 together. I ran into a few difficulties while setting it up myself (namely because Phoenix uses Brunch by default rather than Webpack) so here's a guide on how to do it to make things faster for you!

Versions that I've used
-----------------------

**Phoenix**: v1.2.4

**NPM**: v3.10.10

**Brunch**: v2.10.9

**Typescript**: v2.4.1

**React**: v15.6.1

{'fraction_non_alphanumeric': 0.1349124613800206, 'fraction_numerical': 0.03913491246138002, 'mean_word_length': 3.497685185185185, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5521523', 'n_tokens_mistral': 644, 'n_tokens_neox': 596, 'n_words': 252}