Merge VK UI from 4 to 5 #5078
-
Hi? I want to discuss one problem about the project, I'm making. Version of VK UI in my project is 4.28.1 and now I need to update to 5. But in one place of code, I have this: |
Beta Was this translation helpful? Give feedback.
Answered by
inomdzhon
May 16, 2023
Replies: 1 comment
-
Hi! You could do something like this: import { type PlatformType, classNames, usePlatform } from "@vkontakte/vkui";
function getClassNameWithPlatform(platform: PlatformType) {
switch (platform) {
case 'android':
return 'Example--android';
case 'ios':
return 'Example--ios';
default:
return;
}
}
const Example = () => {
const platform = usePlatform();
return <div className={classNames('Example', getClassNameWithPlatform(platform)} />
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
inomdzhon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
You could do something like this: