rajaraodv / react-redux-blog Goto Github PK
View Code? Open in Web Editor NEWA sample React Redux CRUD app
A sample React Redux CRUD app
ERROR in multi (webpack)-dev-server/client?http://localhost:8080 ./public/src/index.js
Module not found: Error: Can't resolve 'babel' in 'E:\Source Code Personal\ReactJS\react-redux-blog-master'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
You need to specify 'babel-loader' instead of 'babel',
see https://webpack.js.org/guides/migrating/#automatic-loader-module-name-extension-removed
@ multi (webpack)-dev-server/client?http://localhost:8080 ./public/src/index.js
The demo link given https://protected-escarpment-79486.herokuapp.com/ seems to be down.
(Your blog posts are very helpful!)
First of all, thank you for your great posts on Medium explaining Redux step by step! Really helped me understand the basics of Redux.
I was going through your code in this repo and saw the ROOT_URL
constant a few times. I was wondering why you're checking wether the ROOT_URL
includes localhost or not. What's the advantage of using relative paths when running the app on localhost?
This is not an issue but more a question in general :)
I'm obtaining a Promise from axios.post() in request on UserAction, that is asigned to payload attribute at return { type: SIGNIN_USER, payload: request }
, but at dispatch I can't use this promise with .then(), Why you can do this? I had to do this:
let response = dispatch(signInUser(values)); response.payload.then();
What is the difference in your code?
If you are interested, I have posted a question in StackOverflow about it, but I haven't received answers.
First things first - after downloading many react-redux starter projects and repos, your's has been by far the most comprehendible to me. Thanks very much. The fog is clearing.
It looks like the actions for the forgot password functionality that are referenced in /containers/ForgotPwdFormContainer...
import {forgotPwd, forgotPwdSuccess, forgotPwdFailure, resetUserFields } from '../actions/users';
... don't exist in the repo. Do they exist, but did not get pushed up to GH? If you did write them and wouldn't mind sharing them, it would be very much appreciated.
Thanks for sharing this great work
โ npm run dev
[email protected] dev /Users/tony/Projects/react-redux-blog
node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
The "Install MongoDB" link actually links to the "Install on OS X":
https://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/#install-mongodb-community-edition-with-homebrew
It should probably link here:
https://docs.mongodb.com/manual/installation/
Hi rajaraodv, thanks for providing us a such as a nice app, which we can study and learn the redux app with mongodb support, I search the web but couldn't found a good example like this. i learned a lot from you, Please help me in this app.
i have downloaded the repo but when i try to install the dependencies, i got the following error. If you have some time, please take a look. thanks in advance
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"
})
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! F:\react-redux-blog\npm-debug.log
On line 37 of posts.js...
https://github.com/rajaraodv/react-redux-blog/blob/master/routes/posts.js#L37
there are two trailing zeros. Are they intentional?
Good
From the issues filed here, looks like the project is no longer maintained?
If so, would it help to link to currently maintained alternatives?
I got this error from public/src/containers/PostsListContainer.js and I think the reason is fetchPosts
from public/src/actions/posts.js returns a regular js object instead of a Promise that is thenable. As a result I can't get the posts list to show. Anyone else had the same issue?
For those who have this issue. it seems that react-router uses create-react-class, which will need to be aliased to the preact-compat version with webpack, browserify or babel, e.g:
// webpack.config.js
module.exports = {
// ...
alias: {
'react': 'preact-compat',
'react-dom': 'preact-compat',
'create-react-class': 'preact-compat/lib/create-react-class'
}
}
I can't for the life of me figure out how to get the post Id. Can someone show me line number where the post id is created or how it's created? I have a router setup that's similar to this project post/:id. I'm pretty sure the id isn't created on the postNew component. Maybe it's the redux form that creates it? Right now in my project the post leads to post/undefined on the postList component. I'm thinking maybe it's the postDetails component that actually does the state management to give the id. Right now when console.log(this.props) I'm getting the router props but the id is always undefined.
Hi. Should the INITIAL_STATE loading prop not be set to true and only set to false on either FETCH_POSTS_SUCCESS or FETCH_POST_FAILURE?
The loading prop currently is only set to true once the axios promise is resolved due to using the redux-promise middleware. If the initial value of loading is set to true then as soon as the request is initiated loading is true.
Just an observation.
Step to reproduce :
Register with USER 1 ,
Login with USER 1
Copy Token from session storage from user1; Logout user 1
Register with a USER 2
Login with USER 2
Paste in session storage Token of user1 into user2 .
refresh a page you will observe User one dashboard again instead of User 2.
Same issue I am facing with JWT
How the onChange is handled in this example?
react-redux-blog/public/src/components/renderField.js
I am little bit confused here. My example I type anything in the text box doesnt appear.
Please help.
I try to run the build through FOREVER or Pm2. Any ideas how to do it? With pm2 says it runs but it does not work
pm2 start node ./bin/www
I'm interested as id like to see a technique of hitting the protected area, once the user is logged in, on a page refresh. I'd like not to have to verify on the client...
Thank you for your sample app, this is a great learning resource for me. I'm currently trying to make use of your authentication middleware in the app.js file. However, whenever I run the application, create a user and log in with that user, at no time there is a token defined after this line:
var token = req.body.token || req.query.token || req.headers['x-access-token']; console.log('Token: ', token); // <--- always gives me 'Token: undefined'
The login process runs just as expected, the user gets created in mongo and everything looks fine, except for the empty token. It does not matter if I run the production version or the dev version on 8080, I also tried it with Firefox and Opera (on Linux).
Is this an error that is caused by my environment or can you confirm this behaviour? I have been fiddling around with this for some hours now, but it seems I'm too unexperienced with that for now.
Bestr regards,
Rob
Reproduce: Click demo link in the README, click on a post (I choose the first one), hit refresh.
Expected: To see the post
Actual: Not found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.