0

I should use node.js. I would like to use reactjs to render my views. but there are some questions.

  1. pre-defined functions inside reactjs like componentDidMount will work?
  2. I should use redux, is it possible?
  3. which of routing I should use (react or express.js router)?
1
  • 1
    1 - Yes, 2 - Yes, 3 - Wut ? React is a frontend framework, you caa do your frontend routing using react-router and your backend routing using express Commented Jan 7, 2019 at 9:11

2 Answers 2

1

1) Predefined functions like componentDidMount will totally work as well as the other lifecycle events in React.

2) Yes, it's possible, Redux is great for app-state management and preserving data to be used inside the application for each instance.

3) You should make use of both React-Router and Express. You can use React-Router to navigate on the front-end, navigating from page to page. For Express, it's especially useful for developing API routes for your backend if necessary.

Sign up to request clarification or add additional context in comments.

Comments

0
  1. Yes
  2. Yes, It is possible
  3. react-router is for internal App routing. Where Express.js can only route to /index.html on main source.

Eg: myapp.com/reactapp -> done by Express, where index.html is on /reactapp myapp.com/myapp/new/view --> here /new/view is routed by react

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.