question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I'm really struggling to find any documentation or guides about how to use Redux with CRA

See original GitHub issue

Hello!

I’ve just been searching through this project’s README, the create-react-app website and documentation, the Redux website, and a few Google searches, and I can’t seem to find any guides or documentation about how I can use a Redux “template”, or set up some boilerplate for a Redux store/reducers/etc.

I also installed create-react-app with npm install -g create-react-app and ran create-react-app --help, and I can’t see any information about “plugins”, or custom templates, or anything like that.

Then I stumbled onto this GitHub issue, with this comment: “CRA supports both redux and graphql.”

Do they just mean that you’re free to add Redux to your own package.json and then set everything up manually? Or is there an “official” way of setting up some boilerplate code and installing dependencies?

I could have sworn I remember reading a tweet about Redux + CRA, maybe from Dan Abramov, or one of the Redux maintainers. But now all I’m finding on Google are a few Medium posts, and a lot of “boilerplate” repos from random developers. It would be great if there was an official create-react-app integration/plugin for Redux, and if a link to this could be included somewhere in the project README, or on the website.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Nov 11, 2018

I think you may be overestimating how much you need to do to “set up Redux” 🙂

You can clone any project in the examples folder of the Redux repo. They’re bootstrapped with CRA.

0reactions
ndbroadbentcommented, Nov 10, 2018

create-react-app offers typescript support since @2.1.0

Awesome, thanks! That’s really great. I’ve used Flow on a few different projects but am excited to try TypeScript.

Setting up redux and react-redux is not difficult, it is matter of modifying your index.js and setup the redux store. You’ll have to do this regardless of project.

Haha sorry, I’m just lazy. This is probably my fifth or sixth React + Redux project, but the ecosystem moves so fast that I wanted to start from scratch and use the latest versions of everything. I didn’t want to base it on one of my existing projects, because they’re all still on Webpack 2 or 3, and I’ve actually never used create-react-app before.

The boilerplate you’ve linked to has no redux setup, so you would still have to setup react-redux the exact same way as you would in create-react-app.

Yeah, I just remember reading a few comments saying that Semantic UI can be tricky to set up with webpack, so I thought I’d rather get a preconfigured Semantic UI and set up Redux by myself.

I’ve actually decided to use Ant Design for this project, because it’s written with TypeScript, has a really complete set of UI components, and they have a really good guide for getting started with create-react-app.

I might even use the new React hooks as well, and will see if I can just skip Redux. It’s a toy weekend project, so will be a great chance to learn lots of new things and try to keep up with everything.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started with Redux
The recommended way to start new apps with React and Redux is by using the official Redux+JS template or Redux+TS template for Create...
Read more >
How To Manage State in React with Redux - DigitalOcean
Use npm to install the two packages with the following command: npm install --save redux react-redux.
Read more >
Redux Crash Course With React - YouTube
In this video we will talk about what Redux is and build a React app from scratch and add all of the boilerplate...
Read more >
Getting started with React - Learn web development | MDN
There's some other markup that helps create-react-app function, so take care not to edit it unless you know what you're doing. You very...
Read more >
Redux App not working if Redux DevTools Extension is not ...
However, my React Application (bootstrapped with CRA) will not work if I don't have the Redux Devtools Extension installed. Can someone please ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found