facebookexperimental/Recoil

[Q] RecoilStateInfo.subscribers.components.name is "<component name not available>"

開放

#1,518 建立於 2021年12月30日

 (6 則留言) (1 個反應) (0 位負責人)JavaScript (1,151 個分叉)batch import
devtoolshelp wanted

倉庫指標

星標
 (19,428 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Hi there, I'm implementing some kind of devtool.

  const getInfo = useGetRecoilValueInfo_UNSTABLE();
  const info = getInfo(someAtomOrSelector);
  console.log(Array.from(info.subscribers.components));

With this code, I got something like

[
    {
        "name": "<component name not available>"
    },
    {
        "name": "<component name not available>"
    },
    {
        "name": "<component name not available>"
    }
]

It seems the count of the array is correct, but I couldn't get the components' names. All of my components are type of (...) => JSX.Element. How can I get the component name properly?

EDIT; recoil version "recoil": "^0.5.2"

貢獻者指南