export async function getServerSideProps(context: any) {
const { query } = context;
let f: PostsListFilters = {
limit: 24,
offset: 0,
order: '-publishedAt'
};
if (query.page) {
f.offset = f.limit * (query.page - 1);
}
const posts = await postsActions.fetchPosts(f);
return {
props: {
posts: posts.data,
total: posts.meta.total,
}
}
}
useEffect(() => {
if (user) {
fetch(
`//api.github.com/users/${user.login}/repos?page=${currentPage}&per_page=${PER_PAGE}`
)
.then((res) => res.json())
.then(setData);
}
}, [user, currentPage]);
const container = document.getElementById('calendar');
ReactDOM.render(
<App/>,
container
);
location ~ ^/api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:1820;
}
location / {
autoindex on;
root /var/www/dist;
}
const classNames = require('classnames');
...
<div className={classNames( "form-textbox-label", {
"field-active": this.state.fieldActive
})}></div>
<MyInput name="number" validations={{
myCustomIsFiveValidation: function (values, value) {
values; // Вот тут, по идее, есть значения других полей
value; // 5
return 5 === value ? true : 'No five'; // You can return an error
}
}}/>