export { width as responsiveHeight } from "react-native-responsive-dimensions";
I want to export responsiveHeight with name width. What is correct way to do this? As this is not working.
You're actually doing the opposite, you are taking your width function and add it an alias called responsiveHeight, so you need to do this:
export { responsiveHeight } from "react-native-responsive-dimensions";
just as simple as that, export width in that way, it should work with no issue.
width as responsiveHeight this syntax mean?react-native-responsive-dimensionswidth as responsiveHeight you are telling your code export the function/variable called width into react-native-responsive-dimensions and export it as responsiveHeight, I mean you are exporting that with an alias name, so then when you are importing that function you can import it like this: import { responsiveHeight } from '../path/to/file' and not as width because you gave an alias.Try This One.
import React from "react";
import {responsive} from "react-native-responsive-ui";
@responsive
export default class Debug extends React.Component {
render() {
const {width, height} = this.props.window;
console.log(`New window dimensions: ${width}x${height}`);
return null;
}
}