简体   繁体   English

IE11中未呈现的特定React代码

[英]Specific React code not rendered in IE11

I've written a small component that renders correctly in Chrome and Firefox, but not IE11. 我编写了一个小组件,可以在Chrome和Firefox中正确显示,但不能在IE11中显示。 The main entry point to the application has got IE compatibility set: 该应用程序的主要入口点已设置IE兼容性:

doctype html
html
  head
  meta(http-equiv='X-UA-Compatible', content='IE=edge')
  title= title
  link(rel='stylesheet', href='./stylesheets/eventinfo.css')
body
block content

My compoment looks like this: 我的作曲看起来像这样:

import React from 'react';
import { SettingsPane, SettingsPage, SettingsContent, SettingsMenu} from 'react-settings-pane';
import {Col, Form, FormGroup, FormControl, ControlLabel, HelpBlock, Button, Alert, Checkbox} from 'react-bootstrap'
import { Creatable } from 'react-select';

const Settings = React.createClass({

    render: function () {
        var data = this.props.data;
        var envFilter = data["settings.notifications.environments"] || "";
        var isChecked = this.props.data['settings.notifications.receiveMailNotifications'];

        const menu = [
            {
                title: 'Email warnings',
                url: '/settings/notifications'
            }
        ];

        // Save settings after close
        let leavePaneHandler = (wasSaved, newSettings, oldSettings) => {
            // "wasSaved" indicates wheather the pane was just closed or the save button was clicked.

            if (wasSaved) {
                var environmentsObject = newSettings["settings.notifications.environments"];
                var environments = environmentsObject.toString();
                var applications = newSettings["settings.notifications.applications"];

                this.props.onSubmit(newSettings);

            }
        };

        return (
            <SettingsPane items={menu} index="/settings/notifications" settings={data}
                          onChange={this.settingsChanged} onPaneLeave={leavePaneHandler}>
                <SettingsMenu headline="Settings"/>
                <SettingsContent header={true}>
                    <SettingsPage handler="/settings/notifications">
                        <FormGroup>
                            <Col componentClass={ControlLabel} sm={2} />
                            <Col sm={10}>
                                <label>
                                <input
                                    type="checkbox"
                                    checked={isChecked}
                                    onChange={this.props.toggleMailNotification}
                                    />
                                    Receive mail notification for these environments
                                    </label>
                            </Col>
                        </FormGroup>
                        <FormGroup>
                            <Col componentClass={ControlLabel} sm={2}>
                                <div>
                                    <label>Miljø/miljøklasse</label>
                                </div>
                            </Col>
                            <Col sm={10} className="dummy">
                                <Creatable
                                    name="settings.notifications.environments"
                                    options={this.props.options}
                                    value={envFilter}
                                    onChange={this.props.handleEnvironmentsChange}
                                    multi={true}
                                    allowCreate={true}
                                    tabSelectsValue={false}
                                    className="settings-creatable"
                                    placeholder="Enter environments"
                                />
                            </Col>
                        </FormGroup>
                    </SettingsPage>
                </SettingsContent>
            </SettingsPane>
        )
    }
});


export default Settings;

How should I go about identifying exactly what causes IE11 not to render this code? 我应该如何确定到底是什么导致IE11不呈现此代码? There's no error in the console. 控制台中没有错误。 Any advice will be appreciated. 任何建议将被认真考虑。

Thanks for the answers. 感谢您的回答。 I ended up rewriting the code based on react-bootstrap components, instead of debugging this one. 我最终基于react-bootstrap组件重写了代码,而不是调试了这一部分。 Next time I'll use the debugging suggestions provided in the comments section. 下次,我将使用注释部分中提供的调试建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM