Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Setup] Updating Adjust SDK installation instructions for functional components in React Native #210

Open
hatem-72 opened this issue Mar 23, 2023 · 1 comment

Comments

@hatem-72
Copy link

hatem-72 commented Mar 23, 2023

Hello,

I would like to bring to your attention that the installation instructions for the Adjust SDK on the react-native app seem to be a bit outdated in relation to modern react-native standards. As I am planning to install the SDK, I noticed that the instructions are written using class components.

I was wondering if there is any specific reason why class components are used in the readme, and if it would be possible to update the instructions to use functional components instead. For example, would the following code work equally well?

constructor(props) {
    super(props);
    const adjustConfig = new AdjustConfig("{YourAppToken}", AdjustConfig.EnvironmentSandbox);
    Adjust.create(adjustConfig);
}

componentWillUnmount() {
  Adjust.componentWillUnmount();
}
useEffect(() => {
    const adjustConfig = new AdjustConfig("{YourAppToken}", AdjustConfig.EnvironmentSandbox);
    Adjust.create(adjustConfig);
    
    () => {
        Adjust.componentWillUnmount();
    }
}, []);

I appreciate any help you can provide to improve the installation instructions and bring them up to date with current react-native standards.

Thank you!

@ghost
Copy link

ghost commented Mar 29, 2023

what is the need to disassemble the component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant