小编Tal*_*göz的帖子

警告:道具`className` 不匹配。使用带有语义 UI-react 的样式组件时

我使用此代码从顶部边缘我的按钮:

const makeTopMargin = (elem) => {
    return styled(elem)`
        && {
            margin-top: 1em !important;
        }
    `;
}

const MarginButton = makeTopMargin(Button);
Run Code Online (Sandbox Code Playgroud)

每当我使用MarginButton节点时,我都会收到此错误:Warning: PropclassNamedid not match. Server: "ui icon left labeled button sc-bwzfXH MjXOI" Client: "ui icon left labeled button sc-bdVaJa fKCkqX"

你可以在这里看到这个制作。

我该怎么办?

jsx reactjs styled-components next.js semantic-ui-react

24
推荐指数
8
解决办法
3万
查看次数

如何使用JSON数据递归填充TreeView

我有一个winforms树视图,我可以自动读取数据,(一个等于key的节点,里面的节点等于value),但是当读取对象类型时,它内部的值不会是对象的子节点节点(对象的键),(也许我无法解释,这是截图和我的方法.)

layer0需要在纹理内部,并且缩放需要在显示内部

layer0需要在纹理内部,并且缩放需要在显示内部

我的Json:

{
"parent": "builtin/generated",
"textures": {
    "layer0": "mm:items/iron_dust"
},
"display": {       
        "scale": [ 1.7, 1.7, 1.7 ]
 }
}
Run Code Online (Sandbox Code Playgroud)

我自动检测的方法(实际上并非所有我的)

private void Form1_Load(object sender, EventArgs e)
    {
        StreamReader reader = new StreamReader(path);
        string json = reader.ReadToEnd();
        reader.Close();
        JObject obj = JObject.Parse(json);
        getAllProperties(obj);
    }

    void getAllProperties(JToken children)
    {
        TreeNode mainNode = treeView1.Nodes[0];
        mainNode.Text = Path.GetFileNameWithoutExtension(path);
        foreach (JToken child in children.Children())
        {
            var property = child as JProperty;
            if (property != null)
            {
                if (property.Value.Type == JTokenType.String)
                {
                    TreeNode keyNode …
Run Code Online (Sandbox Code Playgroud)

c# treeview json parent-child winforms

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

如何在Heroku安装后编译Typescript?

我不想上载预编译的dist目录,而是想在服务器端编译src。

这是我在package.json中的脚本:

"scripts": {
    "test": "echo \"No test specified\" && exit 0",
    "start": "node dist/app.js",
    "postinstall": "tsc"
  }
Run Code Online (Sandbox Code Playgroud)

这里是依赖项:

"dependencies": {
    "@types/express": "^4.11.1",
    "@types/pg": "^7.4.4",
    "@types/socket.io": "^1.4.31",
    "body-parser": "^1.18.2",
    "express": "^4.16.2",
    "pg": "^7.4.1",
    "socket.io": "^2.0.4",
    "tslint": "^5.9.1",
    "typescript": "^2.7.2"
  }
Run Code Online (Sandbox Code Playgroud)

由于“ npm install将在安装过程中将node_modules / .bin文件夹添加到PATH环境变量中”,因此Heroku应该能够直接调用它。

但是这是我得到的错误:

Building dependencies
       Installing node modules (package.json + package-lock)

       > bilgi-yarismasi@1.0.0 postinstall /tmp/build_afa42c7943d4b71d2b48a016ae3b9e50
       > tsc

       sh: 1: tsc: not found
       npm ERR! file sh
       npm ERR! code ELIFECYCLE
       npm ERR! errno ENOENT
       npm ERR! syscall …
Run Code Online (Sandbox Code Playgroud)

compilation heroku typescript tsc

6
推荐指数
2
解决办法
1757
查看次数

错误:找不到符号类DataBindingComponent

我下载了一个Android项目,但是我收到了这个错误:

Error:(42, 42) error: cannot find symbol class DataBindingComponent
Run Code Online (Sandbox Code Playgroud)

样品导入:

import android.databinding.DataBindingComponent; // no code-time error
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
Run Code Online (Sandbox Code Playgroud)

样品用法:

public FragmentFantasyPointsSingleBinding(DataBindingComponent bindingComponent, View root) {
        super(bindingComponent, root, 0);
        Object[] bindings = ViewDataBinding.mapBindings(bindingComponent, root, 4, sIncludes, sViewsWithIds);
        this.animationView = (LottieAnimationView) bindings[3];
        this.mboundView0 = (FrameLayout) bindings[0];
        this.mboundView0.setTag(null);
        this.progressView = (LinearLayout) bindings[2];
        this.recyclerView = (RecyclerView) bindings[1];
        setRootTag(root);
        invalidateAll();
    }
Run Code Online (Sandbox Code Playgroud)

代码时间没有错误,但在编译时我得到了我提到的错误.

当我尝试在Android Studio上进行定义时,我不能.

应用程序级build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.esports.flank"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName …
Run Code Online (Sandbox Code Playgroud)

java android gradle android-studio android-databinding

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

Firebase异步函数语法错误

我有node.js v8.3.0,并在我的package.json中有这个:

  "engines": {
    "node": ">=8.3.0"
  }
Run Code Online (Sandbox Code Playgroud)

我的await/async测试代码:

async function x() {
    return "test";
}

exports.asyncTest = functions.https.onRequest((request, response) => async function() {
    response.end(await x());
});
Run Code Online (Sandbox Code Playgroud)

预期产出:test
观察到的产出:

Is there a syntax error in your code?
Detailed stack trace: /user_code/index.js:12
async function x() {
      ^^^^^^^^
SyntaxError: Unexpected token function
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at getUserFunction (/var/tmp/worker/worker.js:372:24)
Run Code Online (Sandbox Code Playgroud)

asynchronous node.js firebase google-cloud-functions

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