Skip to content
This repository has been archived by the owner on Apr 3, 2021. It is now read-only.

Fix: Remove error in console #76

Merged
merged 3 commits into from
Jan 29, 2020
Merged

Fix: Remove error in console #76

merged 3 commits into from
Jan 29, 2020

Conversation

aryamanpuri
Copy link
Contributor

@helfi92 helfi92 self-requested a review January 16, 2020 02:05
Copy link
Contributor

@helfi92 helfi92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just do:

diff --git a/src/components/MarkdownTextArea/index.jsx b/src/components/MarkdownTextArea/index.jsx
index ec0c9e5..100dc72 100644
--- a/src/components/MarkdownTextArea/index.jsx
+++ b/src/components/MarkdownTextArea/index.jsx
@@ -107,8 +107,7 @@ export default class MarkdownTextArea extends Component {
   };
 
   render() {
-    const { classes, rows, markdownProps } = this.props;
-    const { onChange, defaultTabIndex, ...props } = this.props;
+    const { classes, rows, markdownProps, onChange, defaultTabIndex, ...props } = this.props;
     const { tabIndex, value } = this.state;
     const isPreview = tabIndex === 1;

@aryamanpuri
Copy link
Contributor Author

@helfi92 Error is of changing MarkdownProps to Markdownprops.

Screenshot from 2020-01-16 20-44-09

@helfi92
Copy link
Contributor

helfi92 commented Jan 16, 2020

Do you still see the error after implementing the diff mentioned above? You can test it by running the components styleguide. https://github.com/mozilla-frontend-infra/components/blob/master/README.md#development-and-contributing

@aryamanpuri
Copy link
Contributor Author

Can you explain to me this, why is the error not showing now ?

@helfi92
Copy link
Contributor

helfi92 commented Jan 16, 2020

It's because markdownProps was being fed to the TextField component. markdownProps is not defined in TextField...

render() {
  const { classes, rows, markdownProps } = this.props;
  const { onChange, defaultTabIndex, ...props } = this.props;
  
  // ...
    
  <TextField
    name="Write"
    onChange={this.handleValueChange}
    fullWidth
    multiline
    rows={rows}
    // ...props  will have markdownProps which is not defined in TextField
    {...props}
    value={props.value || value}
/>
  }

@helfi92
Copy link
Contributor

helfi92 commented Jan 16, 2020

Could you rename the pull-request to follow the convention we use for this repo? https://github.com/mozilla-frontend-infra/components#committing-and-pushing-changes Thanks!

@aryamanpuri aryamanpuri changed the title Changing Props to props Fix: markdownProps defined in TextField Jan 16, 2020
@aryamanpuri
Copy link
Contributor Author

Could you rename the pull-request to follow the convention we use for this repo? https://github.com/mozilla-frontend-infra/components#committing-and-pushing-changes Thanks!

Done

@helfi92 helfi92 changed the title Fix: markdownProps defined in TextField Fix: Remove error in console Jan 29, 2020
Copy link
Contributor

@helfi92 helfi92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@helfi92 helfi92 merged commit 96a280e into mozilla-frontend-infra:master Jan 29, 2020
@helfi92
Copy link
Contributor

helfi92 commented Jan 29, 2020

🎉 This PR is included in version 3.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants