reactjs - 在 iphone 5,6 错误格式 css 中反应 facebook 评论
问题描述
我正在使用 facebook 评论,错误就像图片一样。
const FacebookComment: React.FC<Props> = ({ title }) => {
const isMobile = ...
const [loading, setLoading] = useState(true);
const [dataHref, setDataHref] = useState('');
const rootRef = useRef<HTMLDivElement>(null);
const route = useRouter();
useEffect(() => {...
}, [route]);
useEffect(() => {...
};
try {
window.FB?.Event.subscribe('xfbml.render', handleRendered);
return () => window.FB?.Event.unsubscribe('xfbml.render', handleRendered);
} catch (e) {
// Ignore error
}
}, []);
useEffect(() => {
}, [dataHref]);
return (
<div ref={rootRef} className={isMobile ? css.rootMobile : css.rootDesktop} >
{dataHref && <div className="fb-comments" data-href={dataHref} data-width="100%" data-numposts="5" />}
</div>
);
};
export default FacebookComment;
iphone x
问题:我正在使用上面的代码,但在 iphone 6 和 iphone x 上显示不同。我想修复 iphone 6 上的错误。希望有人能帮助我!!!
解决方案
推荐阅读
- android - 如何从另一个片段中获取适配器
- docker - 如何从 iso 创建和配置基础 docker 镜像
- gis - 此处地图的土地利用/类型信息
- vb.net - VB.NET:多个事件 - 如何只调用一次函数?
- python - 如何找到列表python的最大重复项
- ios - 如何在特定标签栏项目而不是其他项目下添加标题
- scala - 使用 circe 在 Scala 中修改 JSON 数组
- ios - 使用 Cordova Firebase 插件在 iOS 上的前台运行应用程序时向设备和应用程序发送通知
- r - 相同的 Excel 数据,相同的 .RMD 文件,不同的降价结果
- c# - 在 UWP、MVVM 中实现周期性进程