Help

Re: useBase and useCursor not working properly

1646 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Luis_Brito
5 - Automation Enthusiast
5 - Automation Enthusiast
  • useCursor does not re-render my component when the active Table or active View changes
  • useBase does not re-render my component when I add or remove tables or when I rename fields

This was working a week ago. Any feedback?

4 Replies 4
Albrey_Bristo-B
6 - Interface Innovator
6 - Interface Innovator

Hey Luis,

Thank you for raising this bug. Our team has identified the issue and is working on a fix. I’ll follow up once we’ve made progress here.

Albrey

Hey Luis - checking in here. Our team deployed fixes to the bug that disabled your component re-rendering. Can you double check that it’s working properly? Thanks!

Hey Albrey,

It seems to be working as before except that useCursor() works slightly differently.
Before I was able to get the activeTableId property value synchronously when changing tables and when creating a new table, but not when deleting.
Now I can get it when changing or deleting tables but not when creating a new one.

Example:

const base = useBase();
const cursor = useCursor();
const table = base.getTableByIdIfExists(cursor.activeTableId);

When creating a new table cursor.activeTableId is null and this code will throw an error.
I understand that this may be expected and the developer should address that in his implementation; what’s worth mentioning is that it was working before and may affect some applications.

Thanks for flagging, Luis. As you mentioned, we expect that behavior. Here’s the documentation for handling use cases like this for your reference.