Skip to content

Conversation

saseungmin
Copy link
Collaborator

@saseungmin saseungmin commented Nov 24, 2020

πŸš€ μ§„ν–‰ 사항

  • μŠ€ν„°λ”” κΈ€ 등둝 νŽ˜μ΄μ§€μ˜ νƒœκ·Έ 뢀뢄을 λ¦¬νŒ©ν† λ§ ν•œλ‹€.
  • ν…ŒμŠ€νŠΈ μˆ˜μ •

- Refactor Separate components to TagItem and TagList
@saseungmin saseungmin added the refactoring λ¦¬νŒ©ν† λ§ μˆ˜μ •μ‚¬ν•­ μˆ˜μ • label Nov 24, 2020
@saseungmin saseungmin merged commit 9a8b904 into CodeSoom:main Nov 24, 2020
@saseungmin saseungmin mentioned this pull request Nov 24, 2020
20 tasks
<TagListWrapper>
{tags.map((tag) => (
<TagItem
key={tag}

Choose a reason for hiding this comment

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

λ™μΌν•œ tagκ°€ 올 κ²½μš°λŠ” μ—†μ„κΉŒμš”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TagsForm μ»΄ν¬λ„ŒνŠΈμ—μ„œ 쀑볡 값이 μžˆκ±°λ‚˜ 빈 κ°’(value)이면 λ°°μ—΄(inputTags)에 λ„£μ–΄μ£Όμ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

  // TagsForm.jsx

  const validateInput = (value) => {
    if (!value || inputTags.includes(value)) {
      return;
    }

    const resultTags = [...inputTags, value];

    setInputTags(resultTags);
    onChange(resultTags);
  };

  //... μƒλž΅
  const handleSubmit = (e) => {
    if (e.key === 'Enter') {
      validateInput(tag.trim());
      setTag('');
    }
  };

@saseungmin saseungmin deleted the refactoring-tag-in-write-page branch November 24, 2020 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring λ¦¬νŒ©ν† λ§ μˆ˜μ •μ‚¬ν•­ μˆ˜μ •

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants