How do component.$iid is updated? - extjs

I upgraded my project from extjs6.2 to extjs7, and I noticed that while new component is registered the componentManager is looking for component.$iid and it undefined.
And I 'm getting the error: Ext.ComponentManager.register(): Duplicate component instance id "undefined"

Related

Next Build Error - Error occurred prerendering page / TypeError: Cannot read properties of null (reading 'useMemo')

I'm trying to update a 2 year old project, and I've been having so much trouble after updating the dependencies
Right now after running 'next build', I keeps seeing:
Error occurred prerendering page "/japan-vlogs". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useMemo')
for every page in my project
How do I even begin to debug this? The docs site has 5 different options and none of which say anything about the react dom server browser or use memo
screenshots hosted here:
https://github.com/vercel/next.js/discussions/44171#discussion-4678699
The error message "TypeError: Cannot read properties of null (reading 'useMemo')" indicates that you are trying to access a property of an object that is null or undefined. This can occur if you are trying to access a property of an object that has not been initialized, or if you are trying to access a property of an object that has been set to null.
From the Screenshot you provided it indicates that in "JapanVlog" you are trying to use ternary operator or short circuit,
Try this:
Change <Japan/> : null to <Japan/>. if you wanna dynamically display Component try useState Hooks instead
if that doesn't work
Search every function using useMemo() Hooks
Check is any of those function returns null
Hope that works

How to update monitor.getItem() in React Drag and Drop

I was looking through the simple sortable example that React DnD gives in their documentation and they did a
monitor.getItem().index = hoverIndex
on Line 81.
However when I tried to do the same on my project this error occurred:
Uncaught TypeError: Cannot assign to read only property 'index' of object '#<Object>' at Object.drop
And without changing the monitor.getItem() my array goes crazy updating on hover.
Is there another way to update the monitor object?
I figure it out,
on the
beginDrag(props)
I was returning props instead of returning a new object containing
{index: props.index}
Now it works like a charm!

Antd Modal not working

I'm making a react app using antd, I'm trying to add modal but it doesn't work, every time I click the trigger button I got errors saying "Uncaught Error: Element ref was specified as a string (header) but no owner was set. You may have multiple copies of React loaded.". Im following this syntax from https://ant.design/components/modal/
I found related problem https://github.com/jrm2k6/react-markdown-editor/issues/55
and according to react
https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs
they dont recommend using ref attribute, instead use a callback pattern.
I dont know what to do..
Any help, thanks.

Subscription on child component not working in ReactJS

I created a publication(on server) and subscription (on client) in MEteor + React application. My problem is, I can't receive the array returned by the publication. I used console.log in publication and it logs the subscription key and option. I check also documents before returning and it is correct. But in client, still cant get array of documents.
Here is my code for componentDidMount,
Meteor.subscribe("messages",{},{},function(err){
console.log("err",err);
console.log(Messages.find().fetch());
});
console.log here are not called.
Here is my code for publication,
if (Meteor.isServer) {
Meteor.publish('messages', function (key,option) {
console.log(key);
return Messages.find(key,option);
});
}
console.log here is working and also i checked the documents before returning and it is correct.
I used also react-router in my application.I add route for my parent component. The problem i have is in child component.
What is wrong with my code? or how to solve this problem?
I used msavin:mongol and still having 0 for the count of documents.
I think Meteor Chef is promoting a nice folder structure. If you happen to use that, just to make sure your server side actions reach the server, meaning they are imported to the server. Just sharing a screen from one of my projects:
register-api.js is further down imported in main.js in my server folder.
Secondly, what if you do your console.log(Messages.find().fetch()) outside the subscription. You put it into the callback function and should not really be there. What you normally do is to pass the result of Messages.find().fetch() to props in the component's container, so the result needs to be captured outside of your subscription.

Cannot read property 'componentDidLeave' of undefined

I am using Reactjs to create an app, I am receiving that error in the console
Cannot read property 'componentDidLeave' of undefined
It is happening when an item is deleted from a collection. And I am not using componentDidLeave anywhere, so, whats the problem?

Resources