mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
refactor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, {useState} from 'react';
|
||||
import React, {useState, useEffect} from 'react';
|
||||
import {
|
||||
View,
|
||||
Text,
|
||||
@@ -28,7 +28,7 @@ const h = Dimensions.get('window').height;
|
||||
let tagsInputRef;
|
||||
export const ActionSheetComponent = ({
|
||||
close = () => {},
|
||||
item = {},
|
||||
item,
|
||||
setWillRefresh = value => {},
|
||||
hasColors = false,
|
||||
hasTags = false,
|
||||
@@ -39,6 +39,10 @@ export const ActionSheetComponent = ({
|
||||
const [focused, setFocused] = useState(false);
|
||||
const [note, setNote] = useState(item ? item : {});
|
||||
|
||||
useEffect(() => {
|
||||
setNote({...item});
|
||||
}, [item]);
|
||||
|
||||
let tagToAdd = null;
|
||||
let backPressCount = 0;
|
||||
|
||||
@@ -257,6 +261,10 @@ export const ActionSheetComponent = ({
|
||||
|
||||
return (
|
||||
<View
|
||||
onLayout={() => {
|
||||
console.log(item);
|
||||
setNote({...item});
|
||||
}}
|
||||
style={{
|
||||
paddingBottom: 15,
|
||||
backgroundColor: colors.bg,
|
||||
|
||||
Reference in New Issue
Block a user