Crafted with ❤️ by Mobix Software Studio for React Native applications.
// clonning:
git@github.com:mobixsoftwarestudio/react-native-boilerplate.git
Contains all project`s global assets, such as images and videos.
Contains all global components that will be used throughout the application.
Contains all global contexts created with Context API.
Contains all global Hooks.
export const useUser = () => {
const [name, setName] = useState<string>('');
const onChangeName = (value: string) => {
setName(value);
};
return {
name,
onChangeName,
};
};
Contains all global queries.
import { useQuery } from 'react-query';
import axios from 'axios';
import { RequestOptionsType } from '../../types';
type ExampleParams = {
param1: any;
param2: any;
};
type RequestParans = {
param1: any;
param2: any;
requestOptions: RequestOptionsType;
};
type ResponseType = {};
const queryKey = 'example';
const fetchRequest = async ({
param1,
param2,
}: ExampleParams): Promise<ResponseType> => {
return axios
.get(`url.request/${param1},${param2}`)
.then(response => response.data);
};
const useExample = ({
param1,
param2,
requestOptions: { refetchOnWindowFocus, enabled },
}: RequestParans) => {
return useQuery(
[queryKey, { param1, param2 }],
() => fetchRequest({ param1, param2 }),
{
refetchOnWindowFocus,
enabled,
},
);
};
export { useExample, queryKey };
Contains all external services configurations, such as api base url and interceptors.
Contains all theme configurations.
Contains all global types.
Contains every functionally of the application divided by the following folders:
Contains all the assets of this module.
Contains all the components of this module.
Contains all the hooks of this module.
Contains all the queries of this module.
Constains all the screens of this module.
It should also have the following files:
- routes.tsx: responsible for handling the module's routing.
- types.ts: responsible for storing the module's types.