feat: feature/mvp-sprint-1 Fixed bug where value could not be updated with passed path because fullPath was not passed
This commit is contained in:
parent
200cb94321
commit
ae8e066c4f
@ -48,6 +48,10 @@ export const Thingtime = (props) => {
|
|||||||
return props.thing
|
return props.thing
|
||||||
}, [props.thing])
|
}, [props.thing])
|
||||||
|
|
||||||
|
const fullPath = React.useMemo(() => {
|
||||||
|
return props?.fullPath || props?.path
|
||||||
|
}, [props?.fullPath, props?.path])
|
||||||
|
|
||||||
const seen = React.useMemo(() => {
|
const seen = React.useMemo(() => {
|
||||||
if (props?.seen instanceof Array) {
|
if (props?.seen instanceof Array) {
|
||||||
if (props?.seen?.includes(thing)) {
|
if (props?.seen?.includes(thing)) {
|
||||||
@ -191,8 +195,6 @@ export const Thingtime = (props) => {
|
|||||||
nextSeen.push(nextThing)
|
nextSeen.push(nextThing)
|
||||||
}
|
}
|
||||||
|
|
||||||
const fullPath = props?.fullPath || props?.path
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Thingtime
|
<Thingtime
|
||||||
key={idx}
|
key={idx}
|
||||||
@ -254,11 +256,11 @@ export const Thingtime = (props) => {
|
|||||||
const { value } = args
|
const { value } = args
|
||||||
|
|
||||||
console.log("nik value", value)
|
console.log("nik value", value)
|
||||||
console.log("nik props?.fullPath", props?.fullPath)
|
console.log("nik props?.fullPath", fullPath)
|
||||||
|
|
||||||
setThingtime(props?.fullPath, value)
|
setThingtime(fullPath, value)
|
||||||
},
|
},
|
||||||
[props?.fullPath, setThingtime]
|
[fullPath, setThingtime]
|
||||||
)
|
)
|
||||||
|
|
||||||
const atomicValue = React.useMemo(() => {
|
const atomicValue = React.useMemo(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user