Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createCodeForGenerateContent() {
const getNodeKey = ({ treeIndex }) => treeIndex;
const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
let flattenedVar = flatteningNestedArray;
// console.log('theprops ' + this.props.flattenedArray)
let version1 = [];
let version2 = {};
for(let i = 0; i
render() {
console.log(this.state.parents)
const getNodeKey = ({ treeIndex }) => treeIndex;
const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
let flattenedVar = flatteningNestedArray;
// console.log('theprops ' + this.props.flattenedArray)
let version1 = [];
let version2 = {};
for(let i = 0; i
createCodeForGenerateContent() {
const getNodeKey = ({ treeIndex }) => treeIndex;
const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
let flattenedVar = flatteningNestedArray;
/*
version1 is an array of sub-arrays. Within each array, the last element
is the parent of all previous elements.
*/
let version1 = [];
/* For version2, the key is the parent. Value is all of the children
stored as elements in an array.
*/
let version2 = {};
for(let i = 0; i
createParents() {
const getNodeKey = ({ treeIndex }) => treeIndex;
const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
const flattenedArray = flatteningNestedArray.map(ele => {
return ele.node.title
});
const parents = flattenedArray.map((parent, index) => {
return <menuitem value="{index}">
});
this.setState({parents: parents});
}
</menuitem>
updateFlattenedData() {
const getNodeKey = ({ treeIndex }) => treeIndex;
const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
const flattenedArray = flatteningNestedArray.map(ele => {
return ele.node.title
});
this.setState(state => ({
flattenedData: flattenedArray,
flattenedArray: flatteningNestedArray,
textFieldValue: '',
}))
}
updateFlattenedData() {
const getNodeKey = ({ treeIndex }) => treeIndex;
const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
this.setState(state => ({
flattenedArray: flatteningNestedArray,
textFieldValue: '',
}))
}
updateFlattenedData() {
const getNodeKey = ({ treeIndex }) => treeIndex;
const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
this.setState(state => ({
flattenedArray: flatteningNestedArray,
actionName: '',
actionType: '',
reducerName: '',
reducerCase: '',
componentName: '',
containerName: '',
}))
}