小编Rap*_*ent的帖子

Reactjs路由器匹配回调参数始终未定义

我使用该match方法进行服务器端渲染,并且回调中的参数始终未定义.可能出了问题,但这是一整天,我无法理解它.

这是我的服务器端渲染.

// Create location from the history module.
let location = createLocation(req.url);

match({Routes, location}, (error, redirectLocation, renderProps) => {

    // TODO : Verify why this is always undefined
    console.log('ERROR :: ', error)
    console.log('REDIRECT LOCATION :: ', redirectLocation)
    console.log('RENDER PROPS :: ', renderProps)

    if (redirectLocation) {
        res.redirect(redirectLocation.pathname + redirectLocation.search)
    }
    // TODO : Verify why this is breaking
    //else if (error || !renderProps) {
    //  return console.log('Error while starting server :: ', error)
    //}
    else {

        Transmit.renderToString(RoutingContext, renderProps).then(({reactString, …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-router

6
推荐指数
1
解决办法
2856
查看次数

Aria-live在更新后没有说标签

我有这条用JS动态更新的HTML.屏幕阅读器仅在更新时读取新值.它没有说更新的输入标签.

<ul class="points-transfer-detail-points-calculation clearfix">
    <li>
        <label for="points-to-transfer">{{{ pointsToTransferLabel }}}</label>
        <input id="points-to-transfer" type="text" aria-controls="brand-points points-left-after-transfer" placeholder="XXX,XXX" {{#if disabled }}disabled{{/if}}>
        <p id="points-to-transfer-error" class="points-transfer-detail-form-error" aria-hidden="true" role="alert">{{{ pointsToTransferErrorMessage }}}</p>
    </li>
    <li>
        <label for="brand-points">{{{ brandPointsLabel }}}</label>
        <input id="brand-points" type="text" aria-live="polite" aria-atomic="true" disabled>
    </li>
    <li>
        <label for="points-left-after-transfer">{{{ pointsLeftLabel }}}</label>
        <input id="points-left-after-transfer" type="text" aria-live="polite" aria-atomic="true" disabled>
    </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

我曾尝试使用aria-labelledby,aria-describedby,role="alert"aria-label,但没有结果,只有输入的值,永不他的标签.

从我对Google和StackOverflow的所有研究中,我找不到合适的答案.

我在Firefox中使用NVDA作为屏幕阅读器.

谢谢您的帮助.

accessibility wai-aria aria-live

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