Move deprecated AppUI functionality into mobile-ui-react.#75
Move deprecated AppUI functionality into mobile-ui-react.#75tcobbs-bentley wants to merge 5 commits intomainfrom
Conversation
| * deprecated from @itwin/mobile-ui-react. | ||
| * @public | ||
| */ | ||
| export interface ClassNameProps { |
There was a problem hiding this comment.
lets review with the appui team why this was deprecated, and what they expected consumers to do, before we re-export a deprecated type from another repo as public here
There was a problem hiding this comment.
I changed this to draft for now while we decide what to do and created a new PR to allow lint to pass.
| // @todo AppUI deprecation | ||
| // eslint-disable-next-line deprecation/deprecation | ||
| }, [handler]), SessionStateActionId.SetIModelConnection); | ||
| const iModelConnection = useActiveIModelConnection(); |
There was a problem hiding this comment.
I would suggest removing this function since it doesn't add anything that can't be accomplished with useActiveIModelConnection
There was a problem hiding this comment.
SYNCHRO Field uses it in one place, and they take advantage of the fact that they get a callback when it happens. They don't actually care about the value, simply that it changed:
useIModel(() => {
reset();
});Obviously they could update their code to React.useMemo like I do here. I guess we could ask them.
There was a problem hiding this comment.
I would suggest calling useEffect instead of useMemo since the latter is meant for memoizing calculated data (i.e. storing the return value of useMemo).
I think having Field update their code to call useActiveIModelConnection makes sense.
There was a problem hiding this comment.
If SYNCHRO agrees with us removing useIModel, this discussion is moot, but based on my understanding of how useEffect and useMemo work, useEffect will cause an extra render at startup and every time the value changes. Having said that, I am well aware that this is a very non-standard usage of useMemo, so maybe the extra render is not something to worry about.
No description provided.