How to pass data to a reusable component?

Hello,

I have a reusable component that must be conditioned based on the page where it is used. To do that, I wanted to set a property (currentPage) of pageData at “onPageEnter” event and use the value inside “onMounted” event of reusable component. The problem is that “onMounted” event is fired before “onPageEnter”.

What do you recommend to pass data to a reusable component ?

Thank you :slight_smile:

Hello @Seb777

It seems like we need to add a new EventHandler corresponding to OnBeforeMount for a Page, I’m going to discuss it with the team

Regards, Vlad

Hello @vladimir-upirov,

Thank you !

Let me know when there’s something new.

@Seb777

we just released a new On Before Page Enter event handler for a Page

could you please check if it fixes your issue

Regard, Vlad

Great it works ! I appreciate your efficiency.

I just noticed something else. Reusable component events are never called (onBeforeMount, onMounted, onBeforeUnmount).

Is this the normal behavior?

Hello @Seb777,

no, it is not normal. I’ve created the internal ticket (BKNDLSS-28533) in order to fix this.
Thank you for pointing this out!

Regards,
Stanislaw

See also this one: Reusable Component: "On Visibility Change" is not processed

A ticket has been created for this already.

Regards,

Yes, this one is another ticket, and we are going to fix it too.

Hello @Seb777

Sorry for the long wait. We’ve just updated cloud servers with a fix for the issue you described above. Could you kindly let us know whether fix works for you well?

Regards,
Inna

Hello @Inna_Shkolnaya

Yes the fix works well.

Thank you !