# Small action CustomComponent 인자 문제

**URL:** https://meta.discourse.org/t/small-action-customcomponent-argument-issue/383606
**Category:** Development
**Created:** [9월 22, 2025, 11:01오후 UTC](https://meta.discourse.org/t/small-action-customcomponent-argument-issue/383606 "2025-09-22T23:01:47Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [9월 22, 2025, 11:01오후 UTC](https://meta.discourse.org/t/small-action-customcomponent-argument-issue/383606/1 "2025-09-22T23:01:47Z")

</div>

게시물의 작은 액션 설명을 CustomComponent로 선택적으로 대체하려고 합니다.

하지만 게시물이 value transformer에 올바르게 전달되지 않습니다.

[Core 코드](https://github.com/discourse/discourse/blob/5d116eb709ef46eea38f358f89def236a4c62bc7/app/assets/javascripts/discourse/app/components/post/small-action.gjs#L59-L65)

```js
  @cached
  get CustomComponent() {
    return applyValueTransformer("post-small-action-custom-component", null, {
      actionCode: this.code,
      post: this.post,
    });
  }

```

제 디버깅 코드

```js
  api.registerValueTransformer(
    "post-small-action-custom-component",
    (arg) => {
      console.log(arg);
    }
  );

```

출력:

`context: Object { actionCode: "bid", post: undefined }`  
​​  
[테스트](https://github.com/communiteq/discourse/blame/ef29250d781d642d365e8fe2593dff796516eb25/app/assets/javascripts/discourse/tests/integration/components/post/small-action-test.gjs#L70-L77)에서는 매개변수를 확인하지 않기 때문에 이 문제가 발견되지 않았습니다.

`post` 매개변수는 `this.post`가 아니라 `this.args.post`여야 할 것 같습니다.

컴포넌트를 무조건 추가하고 컴포넌트 자체에서 무엇을 해야 하는지 확인하도록 하는 우회 방법을 시도해 보았지만, 불행히도 인수도 올바르게 전달되지 않는 것 같아 우회 방법과 일반적인 구현 모두 여기서 실패합니다:

```js
              <this.CustomComponent
                @code={{this.code}}
                @post={{this.post}}
                @createdAt={{this.createdAt}}
                @path={{this.path}}
                @username={{this.username}}
              />

```

`PostSmallAction`에는 `code`, `createdAt`, `path`를 위한 getter가 있지만(다시 한번) `this.post`는 존재하지 않고, `username()`에도 버그가 있는 것 같습니다(`this.args.post`에 `action_code_who`가 없나요?), 그래서 해당 속성들이 비어 있습니다.

기존의 "실제

---

_[View the full topic](https://meta.discourse.org/t/small-action-customcomponent-argument-issue/383606)._
