Skip to content

This is my file i am facing error #8

@Sivasankar967

Description

@Sivasankar967

this my error
VM691:1 Warning: Cannot update during an existing state transition (such as within render or another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to componentWillMount.

Actually i am facing error in this.setState()

class TemplateTab extends React.Component {
constructor(props) {
super(props);
this.state = {
tabName: "",
key: this.props.activeKey,
searchData: "",
getDetails: "",
onchangeEmailIntegraionValue: "",
userId: "",
popoverDate: "",
modalSize: "",
integrationModalTitle: "",
integrationComponent: "",
savaBtnTxt: "",
CancelBtnText: "",
modalTitle: "",
dynamicParentClass: "",
modalClass: "",
showModal: "",
close: "",
closeBtnTxt: "",
saveBtnTxt: "",
save: "",
title: "",
fname: "",
editOrAdd: "",
tabId: "",
newkey: "0",
canId: "",
tab: this.props.tab,
SearchValue: "",
searchError: false,
SearchErrorMsg: "",
tabSearch: this.props.tabSearch,
startIndex: 0,
ToggleShow: "",
EmailDetails: {
startIndex: 0,
maxIndex: 20,
pageIndex: 0,
candidateState: "new_candidates",
status: false,
titleCount: 0,
carry: 0,
countState: true,
followUpDate:"",
skills: "",
title: "",
experience: "",
education: "",
location: "",
adminCandidateCilentSubmission: "",
adminCandidateStatus: "",
recruiterOwnedBy: "",
availability: "",
jobSearchStatus: "",
lastTitle: "",
lastLocation: "",
recruiterNotes: "",
subscriptions: "",
lastActivity: "",
loginTime: "",
requestStatus: ""
},
disabled: false,
clearSelected: false,
searchforCandidate: false,
WinWidth: window.innerWidth,
sendStatus: "",
campaignStatus:false,
btnName:"Create List",
templateType:"plainEmail",
operation:"",
optionsChecked:[],
subTabActiveKey:0,
userRemoveBtnLoading:false,
userRemoveModal:false,
subTabActiveName:'all'
};
}

getCanId = canId => {
let dis_status = this.props.clikedId ? this.props.clikedId: "";
if (this.props.activeKey === 2 && (this.props.subTabKey === 0 || this.props.subTabKey === 4 || this.props.subTabKey === 5 || this.props.subTabKey === 6) ) {
let AdminCandidate = { newUserListId: canId };
this.setState ({
disabled: dis_status.length != 0 ? false : true,
canId: canId,
AdminCandidate
});
}
console.log("res",canId)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions