小编sam*_*ovS的帖子

如何创建在线SignalR服务器

我已经使用Signalr和Windows Forms构建了一个简单的聊天应用程序,但是我的应用程序是自托管的,并且只能在我的本地主机地址上运行,如何在azure上在线上传服务器并将桌面客户端应用程序连接到它?我刚刚开始学习Signalr。我已经在Google上进行了一些研究,但找不到能回答我问题的任何东西。

c# azure signalr

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

为什么我无需绑定或使用箭头功能React就可以使用this.state

我知道箭头函数继承了父级的上下文,这就是为什么它们在React中如此有用的原因。但是,我有这个React组件:

import React, { Component } from 'react';
import { View, Text } from 'react-native';
import axios from 'axios';


class AlbumList extends Component {
    constructor(props) {
        super(props);
        this.state = {
            albums: [],

        };

        axios.get('https://rallycoding.herokuapp.com/api/music_albums')
            .then(response => {
                 this.setState({ albums: response.data });
            });
    }


    renderAlbums() {
        const { albums } = this.state;
        const array = albums.map(album => (
                <Text>{album.title}</Text>
            ));

        return array;
    }


    render() {
        return (
            <View>
                { this.renderAlbums() }
            </View>
        );
    }
}

export default AlbumList;
Run Code Online (Sandbox Code Playgroud)

并且{ this.renderAlbums() …

javascript ecmascript-6 reactjs react-native arrow-functions

4
推荐指数
1
解决办法
81
查看次数