I’m using the PropertyTree.write(_) method and successfully writing values to the property.
The thing is, its writing to the the property of every instance of my component…not what I was looking for. The property I’m writing to is a bound tag and each instance of my component is bound to a different tag…I need to be able to target a specific component instance.
EDIT: I was wrong…it wasn’t doing the above…it just appeared to do that.
@kirsty , I’m guessing this is the behavior you’re looking for as well? Did you solve it? Please share if you did
Incidentally, I learned that writing to a property from the getPropsReducer(_) method will cause that same method to be call when you write setting up a possibility for an continuous loop if the value you’re writing changes frequently.
Not sure if my solution is helpful to tag bindings but here is how I solved it…The component I was working on was a calendar/scheduler with a drag and drop feature. I wanted the property tree to change every time an event was dropped to a new timeslot. The component was bound to SQL queries. I ended up solving it by having a “Save” button that would write changes to the database, and then the SQL query binding would refresh the property tree for me.
I couldn’t figure out how to use the tree.write() method. Also, React docs state that props should be read only and a component must never modify its own props, so I thought passing new data to the component was probably a better way of going about it regardless.
After @bas.dejong posted the solution to tree.write() I tested it out and it worked. But I didn’t use it with bindings and I still prefer to pass new props to the component.