basic setup
npm install @karthickumarelumalai/rn-basic-setup
A basic setup for React Native applications.
To install this package, run the following command:
``zsh`
npm install @karthickumarelumalai/rn-basic-setup
`
import React from 'react';
import { CustomButton } from '@karthickumarelumalai/rn-basic-setup';
const App = () => {
return (
);
};
`
`
import React from 'react';
import { CustomImage } from '@karthickumarelumalai/rn-basic-setup';
const App = () => {
return (
);
};
`
`
import React, { useState } from 'react';
import { CustomInput } from '@karthickumarelumalai/rn-basic-setup';
const App = () => {
const [text, setText] = useState('');
return (
value={text}
onChangeText={(text) => setText(text)}
style={{ width: 200, height: 40 }}
/>
);
};
`
`
import React from 'react';
import { CustomText } from '@karthickumarelumalai/rn-basic-setup';
const App = () => {
return (
);
};
`
`
import React from 'react';
import { CustomFlatList } from '@karthickumarelumalai/rn-basic-setup';
const App = () => {
const data = ['Item 1', 'Item 2', 'Item 3'];
return (
renderItem={({ item }) =>
style={{ width: 200, height: 200 }}
/>
);
};
`
import React, { useState } from 'react';
import { CustomRadioButton } from '@karthickumarelumalai/rn-basic-setup';const App = () => {
const [selected, setSelected] = useState(false);
return (
selected={selected}
onPress={() => setSelected(!selected)}
style={{ width: 20, height: 20 }}
/>
);
};
`CustomLoadingScreen:
`
import React, { useState } from 'react';
import { CustomLoadingScreen } from '@karthickumarelumalai/rn-basic-setup';const App = () => {
const [visible, setVisible] = useState(true);
return (
);
};
`
CustomApi: Created using Axios
`getRequest` and `postRequest``
// Example of a GET requestconst getData = async () => {
try {
const response = await getRequest("YOUR BASE URL","END POINT");
console.log("Get Response:",response)
} catch (error) {
console.error(error);
}
};
``
// Example of a POST requestconst postData = async () => {
const payload = { key: "value" }; // Your payload data
try {
const response = await postRequest("YOUR BASE URL","END POINT", payload);
console.log("Post Response:", response);
} catch (error) {
console.error(error);
}
};
``https://github.com/Karthickumar1006/react-native-custom-components