File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ interface Props {
21
21
22
22
export const Section : React . FC < Props > = props => {
23
23
const [ isDragging , setIsDragging ] = useState ( false ) ;
24
- console . log ( "SECTION props.church" , props . church )
25
24
26
25
27
26
const getElements = ( ) => {
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ interface Props {
16
16
}
17
17
18
18
export const SectionBlock : React . FC < Props > = props => {
19
- console . log ( "SECTION BLOCK" )
20
19
21
20
const getEdit = ( ) => {
22
21
if ( props . onEdit ) {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export const FormElement = (props: Props) => {
13
13
const [ isFormSubmitted , setIsFormSubmitted ] = useState < boolean > ( false ) ;
14
14
const [ unRestrictedFormId , setUnRestrictedFormId ] = useState < string > ( "" ) ;
15
15
const formId = props . element . answers . formId ;
16
+ const [ currentChurch , setCurrentChurch ] = useState < ChurchInterface > ( props . church ) ;
16
17
17
18
console . log ( "church: " , props . church ) ;
18
19
console . log ( "formId: " , formId ) ;
@@ -21,10 +22,16 @@ export const FormElement = (props: Props) => {
21
22
22
23
23
24
useEffect ( ( ) => {
24
- if ( formId && props . church ) {
25
+ console . log ( "changing church:" ) ;
26
+ setCurrentChurch ( props . church ) ;
27
+ } , [ props . church ] ) ;
28
+
29
+ useEffect ( ( ) => {
30
+ console . log ( "church prop changed: " )
31
+ if ( formId && currentChurch ) {
25
32
loadData ( ) ;
26
33
}
27
- } , [ formId , props . church ] ) ;
34
+ } , [ formId , currentChurch ] ) ;
28
35
29
36
const loadData = ( ) => {
30
37
ApiHelper . get (
You can’t perform that action at this time.
0 commit comments