[PR #38] [MERGED] Refactor components props #235

Closed
opened 2026-05-05 11:56:30 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kusti8/proton-native/pull/38
Author: @alejandronanez
Created: 3/2/2018
Status: Merged
Merged: 3/3/2018
Merged by: @kusti8

Base: masterHead: refactor-component-props


📝 Commits (1)

  • bca35ee Refactor components props

📊 Changes

23 files changed (+46 additions, -46 deletions)

View changed files

📝 src/components/Button.js (+2 -2)
📝 src/components/Checkbox.js (+2 -2)
📝 src/components/ColorButton.js (+2 -2)
📝 src/components/Combobox.js (+2 -2)
📝 src/components/EditableCombobox.js (+2 -2)
📝 src/components/Entry.js (+2 -2)
📝 src/components/FontButton.js (+2 -2)
📝 src/components/Form.js (+2 -2)
📝 src/components/Grid.js (+2 -2)
📝 src/components/Group.js (+2 -2)
📝 src/components/HorizontalBox.js (+2 -2)
📝 src/components/HorizontalSeparator.js (+2 -2)
📝 src/components/MenuBar.js (+2 -2)
📝 src/components/MultilineEntry.js (+2 -2)
📝 src/components/PasswordEntry.js (+2 -2)
📝 src/components/ProgressBar.js (+2 -2)
📝 src/components/RadioButton.js (+2 -2)
📝 src/components/Slider.js (+2 -2)
📝 src/components/Spinbox.js (+2 -2)
📝 src/components/Tab.js (+2 -2)

...and 3 more files

📄 Description

The goal of this PR is to improve the way we compose universalDefaultProps and universalPropTypes.

By moving the destructuring statement on top of the object we ensure that any of the properties listed will not be overwritten by the defaults.

For example

var foo = {
  name: 'proton'
};

var barNotOk = {
  name: 'this will not work',
  ...foo
};

var barOk = {
  ...foo,
  name: 'this will work'
};

console.log(barNotOk); // { name: 'proton' }
console.log(barOk); // { name: 'this will work' }

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kusti8/proton-native/pull/38 **Author:** [@alejandronanez](https://github.com/alejandronanez) **Created:** 3/2/2018 **Status:** ✅ Merged **Merged:** 3/3/2018 **Merged by:** [@kusti8](https://github.com/kusti8) **Base:** `master` ← **Head:** `refactor-component-props` --- ### 📝 Commits (1) - [`bca35ee`](https://github.com/kusti8/proton-native/commit/bca35ee06c8004861e9bb4b635e5c8dfe75afb91) Refactor components props ### 📊 Changes **23 files changed** (+46 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `src/components/Button.js` (+2 -2) 📝 `src/components/Checkbox.js` (+2 -2) 📝 `src/components/ColorButton.js` (+2 -2) 📝 `src/components/Combobox.js` (+2 -2) 📝 `src/components/EditableCombobox.js` (+2 -2) 📝 `src/components/Entry.js` (+2 -2) 📝 `src/components/FontButton.js` (+2 -2) 📝 `src/components/Form.js` (+2 -2) 📝 `src/components/Grid.js` (+2 -2) 📝 `src/components/Group.js` (+2 -2) 📝 `src/components/HorizontalBox.js` (+2 -2) 📝 `src/components/HorizontalSeparator.js` (+2 -2) 📝 `src/components/MenuBar.js` (+2 -2) 📝 `src/components/MultilineEntry.js` (+2 -2) 📝 `src/components/PasswordEntry.js` (+2 -2) 📝 `src/components/ProgressBar.js` (+2 -2) 📝 `src/components/RadioButton.js` (+2 -2) 📝 `src/components/Slider.js` (+2 -2) 📝 `src/components/Spinbox.js` (+2 -2) 📝 `src/components/Tab.js` (+2 -2) _...and 3 more files_ </details> ### 📄 Description The goal of this PR is to improve the way we _compose_ `universalDefaultProps` and `universalPropTypes`. By moving the destructuring statement on top of the object we ensure that any of the properties listed will not be overwritten by the defaults. For example ```js var foo = { name: 'proton' }; var barNotOk = { name: 'this will not work', ...foo }; var barOk = { ...foo, name: 'this will work' }; console.log(barNotOk); // { name: 'proton' } console.log(barOk); // { name: 'this will work' } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 11:56:30 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/proton-native#235
No description provided.