You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing a lib and one of my components has a bool flag that is really only meant to be used internally within the lib. The component is declared within a parent component and the flag is set declaratively:
<MyComponent MyFlag=true />
According to the compiler, the parameter must be public and can't be internal.
The only other way is to make the flag a regular internal field (not a component parameter), then get a @ref of the child component within the parent in the OnAfterRender(), and set the flag at that point. This is too late in the lifecycle for my need.
I've tried not including the child component in the markup and instead instantiating it within the parent code, but it introduces a whole other level of annoyance, and I think not a recommended approach.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm developing a lib and one of my components has a bool flag that is really only meant to be used internally within the lib. The component is declared within a parent component and the flag is set declaratively:
<MyComponent MyFlag=true />
According to the compiler, the parameter must be public and can't be internal.
The only other way is to make the flag a regular internal field (not a component parameter), then get a @ref of the child component within the parent in the
OnAfterRender()
, and set the flag at that point. This is too late in the lifecycle for my need.I've tried not including the child component in the markup and instead instantiating it within the parent code, but it introduces a whole other level of annoyance, and I think not a recommended approach.
Is there a solution for this use case?
Beta Was this translation helpful? Give feedback.
All reactions