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

Web3ConfigProvider should inherit the props from the parent Web3ConfigProvider #417

Open
yutingzhao1991 opened this issue Dec 28, 2023 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@yutingzhao1991
Copy link
Collaborator

Dealing with the following common situations:

<Web3ConfigProvider locale={{
  ConnectButton: {
    connect: 'Connect'
  }
}}>
  <Web3ConfigProvider>
    <ConnectButton />
  </Web3ConfigProvider>
</Web3ConfigProvider>
@yutingzhao1991 yutingzhao1991 added enhancement New feature or request help wanted Extra attention is needed labels Dec 28, 2023
@yutingzhao1991
Copy link
Collaborator Author

<Web3ConfigProvider locale={{
  ConnectButton: {
    connect: 'Connect'
  }
}}>
  <Web3ConfigProvider extendsContextFromParent>
    <ConnectButton />
  </Web3ConfigProvider>
</Web3ConfigProvider>

Add a extendsContextFromParent props for it.

@kiner-tang
Copy link
Member

<Web3ConfigProvider locale={{
  ConnectButton: {
    connect: 'Connect'
  }
}}>
  <Web3ConfigProvider extendsContextFromParent>
    <ConnectButton />
  </Web3ConfigProvider>
</Web3ConfigProvider>

Add a extendsContextFromParent props for it.

Why add the extendsContextFromParent property, shouldn't providers naturally support automatic nested configuration merging

@yutingzhao1991
Copy link
Collaborator Author

<Web3ConfigProvider locale={{
  ConnectButton: {
    connect: 'Connect'
  }
}}>
  <Web3ConfigProvider extendsContextFromParent>
    <ConnectButton />
  </Web3ConfigProvider>
</Web3ConfigProvider>

Add a extendsContextFromParent props for it.

Why add the extendsContextFromParent property, shouldn't providers naturally support automatic nested configuration merging

There are many attributes related to blockchain involved, and I'm concerned that merging by default could cause confusion. But after giving it more thought, perhaps not merging could lead to even more confusion.

So, let's go with the default merge. However, perhaps we can add an extendsContextFromParent=false to support cases where users do not want to merge.


涉及到很多区块链相关的属性,担心默认合并会带来误导。不过仔细想了想,也许不合并会带来更多误导。

那还是默认合并吧,不过或许可以加一个 extendsContextFromParent=false 来支持用户不希望合并的情况。

@cong1223
Copy link
Contributor

cong1223 commented Jan 3, 2024

<Web3ConfigProvider locale={{
  ConnectButton: {
    connect: 'Connect'
  }
}}>
  <Web3ConfigProvider extendsContextFromParent>
    <ConnectButton />
  </Web3ConfigProvider>
</Web3ConfigProvider>

Add a extendsContextFromParent props for it.

Why add the extendsContextFromParent property, shouldn't providers naturally support automatic nested configuration merging

I totally agree with you, props extendsContextFromParent is confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants