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

Question about getContainerOptions #92

Open
juliarvalenti opened this issue Sep 20, 2022 · 0 comments
Open

Question about getContainerOptions #92

juliarvalenti opened this issue Sep 20, 2022 · 0 comments

Comments

@juliarvalenti
Copy link

juliarvalenti commented Sep 20, 2022

Hello,

First of all, thank you so much for your work on this project. It's been immensely helpful for our team.

We ran into issues using this package directly because we are running React 18.2 and we ran into dependency conflicts with the React 16 version of this repo. Therefore, we've decided to port the components into our own codebase and we'll personally maintain them for our own project. This is fine for us, because the codebase is small.

I did want to make sure that I'm doing my due diligence in understanding how this package functions and I just had a question about this bit of code in Container.tsx:

   ...
      if (typeof prop === 'function') {
        result[optionName] = (...params: any[]) => {
          return (this.props[optionName] as Function)(...params);
        }
   ...

I have never seen this pattern before. Would it be possible to explain what is going regarding function props here? Why is this necessary? Is it because React handles Object/Array/Function prop updates as Pass-by-Reference instead of Pass-by-Value?

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