New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
merge! can't access root component #550
Comments
I noticed that if you change this example to actually use add-root then it works just fine. I haven't pinpointed the exact issue yet but when using om/mock-root I noticed that this call returns null (https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L1369):
It appears that the item at :root in this case neither implements IQuery or is a function so the get-query does not handle it. |
I'm looking into this further. One note: You forgot |
I reduced it even further and when just trying to access the reconciler from the repl with the mock root it errors. However using the actual root it's fine. Seems like it must be related to not providing a target. |
Yeah, so when using mock-root, then a direct call to the factory function is used as the Line 1392 in e6b3bb7
get-query . The resulting component fails both the isFunction , and implements? IQuery tests in get-query.
|
As a workaround, you can use the devcards dom-node helper:
|
Left a comment on the pull requests, but it seems the only reasonable solution is to remove mock root and advise the use of dom-node as @awkay mentions above. Then, a constraint could be added to the target to ensure that it's either a dom node (react) or number (react native). |
fixed 4b0a9af |
The code above demonstrates an issue when merging new data into Om.next. Running the example above you can see that when we ask to merge the new
delta
the database is going to be{:om.next/tables #{}, :om.next/queries nil}
.You can send the query manually, if you do so it will work as expected, on the code I found at this line: https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L1369, which leads me to believe that by default it should be getting it automatically from the
:root
, I believe the error is around the management of the:root
component value at:state
.The text was updated successfully, but these errors were encountered: