Intro
The core package @react-native-ama/core
offers essential hooks and components needed to create an app with accessibility in mind.
Installation
Install the @react-native-ama/core
package with your favourite package manager:
- npm
- Yarn
- pnpm
npm install @react-native-ama/core
yarn add @react-native-ama/core
pnpm add @react-native-ama/core
Config File
When you install the @react-native-ama/core
package, the ama.rules.json file should be generated automatically. In cases it doesn't generate automatically, run the following from the root of your project:
# Create ama.rules.json with an empty JSON object if it doesn't exist
echo "{}" >> ama.rules.json
# Navigate to the internal directory
cd node_modules/@react-native-ama/internal
# Create symlinks in src and dist directories
ln -s ../../../ama.rules.json src/ama.rules.json
ln -s ../../../ama.rules.json dist/ama.rules.json
# Go back to the root directory
cd -
For more detailed information about the config file, please refer to this documentation.
Usage
You must include the AMAProvider in your app, as some components and hooks require it.
import { AMAProvider } from '@react-native-ama/core';
export const App = () => {
return (
<AMAProvider>
<YourApp />
</AMAProvider>
);
};