小编Vag*_*ntz的帖子

react bootstrap 预期的声明或声明

我正在尝试react-bootstrap与 Typescript一起使用,但出现此错误。

/home/vagnerwentz/Documents/www/wecanclub/node_modules/react-bootstrap/esm/index.d.ts
TypeScript error in /home/vagnerwentz/Documents/www/wecanclub/node_modules/react-bootstrap/esm/index.d.ts(2,1):
Declaration or statement expected.  TS1128

    1 | export { default as Accordion } from './Accordion';
  > 2 | export type { AccordionProps } from './Accordion';
      | ^
    3 | export { default as AccordionContext } from './AccordionContext';
    4 | export { default as AccordionCollapse } from './AccordionCollapse';
    5 | export type { AccordionCollapseProps } from './AccordionCollapse';
Run Code Online (Sandbox Code Playgroud)

typescript react-bootstrap

15
推荐指数
2
解决办法
5634
查看次数

将 SQL 文件导入 DBeaver

我正在使用 DBeaver 来处理数据库。

|/MariaDB-mysql
|-- /information_schema
|-- /mysql
|-- /performance_schema
|-- /autoparanaiba
Run Code Online (Sandbox Code Playgroud)

我想.sql在其中运行一些文件,autoparanaiba但我没有找到IMPORT.

mysql mariadb dbeaver

14
推荐指数
1
解决办法
5万
查看次数

连接蓝牙模块后数据丢失

客观的

我试图在连接后从蓝牙设备返回数据,因为要使用读写功能,需要一些数据。示例数据name, overflowServiceUUIDs, solicitedServiceUUIDs, mtu, rssi...和许多其他数据。因为如果我想读或写,我需要一些属性。我正在使用图书馆react-native-ble-plx

怎么了?

设备连接后,我丢失了一些值。

重要的

type DeviceState = {
  connected: boolean;
  services: Service[];
  device: Device | null;
  characteristics: Record<string, Characteristic[]>;
};

const INITIAL_DEVICE_STATE = {
  connected: false,
  services: [],
  device: null,
  characteristics: {},
};
Run Code Online (Sandbox Code Playgroud)
const [adapterState, setAdapterState] = useState(false);
const [bleDevices, setBleDevices] = useState<Device[]>([]);
const [isScanning, setIsScanning] = useState(false);
const [connectedDevice, setConnectedDevice] = useState<DeviceState>(
    INITIAL_DEVICE_STATE,
);

# The state isScaning is used to be if we are scanning devices.
# The connectedDevice …
Run Code Online (Sandbox Code Playgroud)

bluetooth bluetooth-lowenergy typescript react-native react-native-ble-plx

11
推荐指数
1
解决办法
610
查看次数

如何使用 Typescript 将对象传递给 ReactJS 中的自定义子组件?

客观的

我想通过useEffect()(并将它们设置为状态)获取应用程序根组件中的数据,然后将状态传递给我的自定义组件。我可以使用 JS 完成此操作,但相同的步骤不适用于 Typescript。

我的错误消息如下:

Type '{ obj: Person; }' is not assignable to type 'IntrinsicAttributes 
& Person & { children?: ReactNode; }'. Property 'obj' does not exist 
on type 'IntrinsicAttributes & Person & { children?: ReactNode; }'.TS2322
Run Code Online (Sandbox Code Playgroud)

对我来说,看起来我有一个 Person 类型的对象,我无法分配给另一种类型的 Person...

应用程序.tsx

import React, { useState, useEffect } from 'react';
import Profile from '../Profile';

export interface Person {
  name: string;
  email: string;
  dob: string;
  address: string;
  number: string;
  userName: string;
  pssw: string;
};

const initPerson: Person …
Run Code Online (Sandbox Code Playgroud)

javascript typescript reactjs react-component

2
推荐指数
1
解决办法
9942
查看次数