I’m guessing you’re worried about the IDE throwing an exception when you call
RegisterComponent for your FMX
TRohit after already having called
RegisterComponent for your VCL
TRohit. Is that correct?
TRohit is a non-visual component then you most likely only need to call
RegisterComponent once for it and it will be available for both VCL and FMX.
TRohit is a visual component then the FMX and VCL versions need to be different classes in different units (and probably different packages too). In this case
RegisterComponent and the IDE are smart enough to know that your FMX and VCL
TRohit components do not exist in the same namespace and will not throw an exception.
If you want to write a single source
TRohit visual component then it’s theoretically possible but I wouldn’t recommend it. FMX and VCL are similar at the application programmer level but at the component author level they are radically different.