UNSAFE_componentWillReceiveProps = (newProps) => {
this.setState({ TaskLists: newProps.stateTaskLists });
this.setState({ locationPathname: newProps.match.params.chapter });
this.setState({ TaskListsItemsSort: newProps.taskListsItemsSort });
this.setState((prevState) => { return { currentPage: newProps.currentPage === null ? prevState.currentPage : newProps.currentPage } });
}
CModule::IncludeModule("iblock");
$ipropIblockTemplates = new \Bitrix\Iblock\InheritedProperty\IblockTemplates(4);
$templates = $ipropIblockTemplates->findTemplates();
$newTemplates=array('TEST'=>$templates['SECTION_META_TITLE']['TEMPLATE']." дополнительный текст - {=this.Name}");
$ipropIblockTemplates->set($newTemplates);
"use strict";
import React from 'react';
import ReactDOM from 'react-dom'; /* для работы с веб страницами */ // модуль React для работы с веб-страницами import {render} from 'react-dom';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import 'normalize.css';
import './styles/style.css';
import TaskMain from './page/MainPage.js';
import combinedReducer from "./stores/stores.js";
const store = createStore(combinedReducer);
ReactDOM.render(<Provider store={store}><TaskMain /></Provider>, document.getElementById('root'));
// Import the functions you need from the SDKs you need
import { initializeApp } from 'firebase/app';
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';
import { getDatabase, ref, set, get, child, push, update, remove, query, onValue, runTransaction, onChildChanged, serverTimestamp } from "firebase/database";
import { OPEN_FORM_TASK_ITEM_NEW, OPEN_FORM_TASK_ITEM_EDIT, OPEN_FORM_NEW_TASK_CAPTION, OPEN_FORM_EDIT_TASK_CAPTION, TASKS_LOAD_REQUEST, BOOK_LOAD_REQUEST } from '../stores/const.js';
вот это функция срабатывает при тзменениях в базе
onChildChanged(ref(database, "keeps/sectionlist/"), (data) => {
console.log("onChildChanged");
console.log(data);
/*setCommentValues(postElement, data.key, data.val().text, data.val().author);*/
});
addNewTaskItem = () => {
let data = { keychapter: this.state.openFormTaskItemNew.keychapter, title: this.inputTaskItemName.current.value, text: this.inputTaskItemText.current.value };
actionsetNewTaskItem(data, this.props.dispatch);
}
addNewTaskItem = () => {
console.log("тест тест");
console.log(this.inputTaskItemName);
let data = { keychapter: this.state.openFormTaskItemNew.keychapter, title: this.inputTaskItemName.value, text: this.inputTaskItemText.value };
actionsetNewTaskItem(data, this.props.dispatch);
}