我正在为 React 中的高阶组件而苦苦挣扎。我正在尝试使用Solidreact-components
加载用户的个人资料数据useLDflex()
。我的代码抛出了一个我无法理解的错误;我不确定问题是否与 React、高阶组件或 Solid 的库有关。任何人都可以帮忙吗?
代码(反应/TSX):
import { useLDflex } from '@solid/react';
import React from 'react';
class Profile extends React.Component<{name: string}, {}> {
render() {
return (
<main role="Profile">
<div className="container">
Name: {this.props.name}
</div>
</main>
)
}
}
interface IProfileId {
profileId: string;
}
const withName = (Component: any) => ({profileId}: IProfileId) => {
const webId = `https://${profileId}.solidcommunity.net/profile/card#me`;
const [name, namePending, nameError] = useLDflex(`[${webId}].name`);
return <Component name={name} />
}
export const newProfile = withName(Profile);
错误(在线):
Error: Specify at least one term when calling .next() on a path