React renderToString не имеет контрольной суммы data-реагировать-контрольной суммы - PullRequest
0 голосов
/ 26 мая 2018
    // renderToString
try {
    initView = renderToString(
        <Provider store={store}>
            <StaticRouter location={location} context={context}>
                {renderRoutes(routes)}
            </StaticRouter>
        </Provider>
    );
    console.log('lzr======');
    console.log(initView);
    console.log('lzr======');
}

запустив это, получите initView, как показано ниже:

<div data-reactroot=""><div></div><div><div class="common-side-bar"><a href="/"><div class="bar-top"></div></a><div class="pandect"><span class="icon-pandest"></span>some thing</div><div class="menu"><ul style="width:180px" class="ant-menu ant-menu-inline ant-menu-dark ant-menu-root" role="menu" aria-activedescendant="" tabindex="0"><li class="ant-menu-submenu-inline ant-menu-submenu"><div style="padding-left:24px" class="ant-menu-submenu-title" aria-expanded="false" aria-owns="iot$Menu" aria-haspopup="true"><span><i class="icon-iothub common-icon">....

Я сделал initView.indexOf ('check') и получил -1.Кто-нибудь может мне помочь, спасибо.

1 Ответ

0 голосов
/ 22 ноября 2018

Я нашел это pullrequest , в котором удалены контрольная сумма data-реагирует и контрольная сумма данных.

...