Answer the question
In order to leave comments, you need to log in
Is it smart to blog with React?
Good day!
After sitting a little on the react, I wanted to create something interesting and complex. Create a blog.
And I want to achieve such an effect , the question is whether this is realizable in react?
As I understand it, we will simply change the state of the main component to the selected state, which will be loaded by AJAX.
If this is feasible, how bad is it for search?
If there are people who understand this ...
Thank you all for yelling
Answer the question
In order to leave comments, you need to log in
Yes, there is nothing complicated.
I am using react+redux.
Store "Articles" -> REST actions: request for a list of posts, request for a post (create/update/delete if necessary). Each event has a request/success/failure state. We just create 3 constants for each event:
const prefix = '@@ARTICLE/';
export const REQUEST = `${prefix}REQUEST`;
export const RECEIVE_SUCCESS = `${prefix}RECEIVE_SUCCESS`;
export const RECEIVE_FAILURE = `${prefix}RECEIVE_FAILURE`;
import { REQUEST, ... и другие нужные константы } from '../constants';
const LoadPost = postId => (dispatch) => {
dispatch({ type: REQUEST, id: postId });
fetch(куда нам надо)
.then(r => r.json())
.then((request) => {
// обработка успеха
})
.catch((ex) => {
// обработка ошибки
})
}
maybe but why?
animation is still normal js/css - adding react (exactly like any other framework will only complicate the task)
Do it, do it!
For search it doesn't matter if you do it well... pre-rendering and the content of the site and pages will be good
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question