Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('Should be possible to return void from render SFC', () => {
// SFC
const MyComponent: SFC = () => {
return;
};
render(
, // Error: JSX element type 'InfernoNode' is not a constructor function for JSX elements. Type 'string' is not assignable to type 'Element | null'
container
);
});
export function unmountComponentAtNode(container) {
render(null, container);
return true;
}
afterEach(function() {
render(null, container);
container.innerHTML = '';
document.body.removeChild(container);
});
afterEach(function() {
render(null, container);
container.innerHTML = "";
document.body.removeChild(container);
});
expect(() => render(errorNode, container)).toThrowError(
'Inferno Error: Encountered child without key during keyed algorithm. If this error points to Array make sure children is flat list. Location: \n>> <div>\n>> <div>'</div></div>
Bootstrap 4 Docs
<div>
</div>
)
}
}
if (typeof window !== 'undefined') {
render(, document.getElementById('app'))
}
<span>1b</span>
<div>1c</div>
<span>2a</span>
<span>2b</span>
<span>2c</span>
,
container
);
expect(container.innerHTML).toBe('<span>1a</span><span>1b</span><div>1c</div><span>2a</span><span>2b</span><span>2c</span>');
render(
<span>1a</span>
<span>1c</span>
<span>2a</span>
<span>2b</span>
<span>2c</span>
,
container
);
expect(container.innerHTML).toBe('<span>1a</span><span>1c</span><span>2a</span><span>2b</span><span>2c</span>');
afterEach(function() {
render(null, container);
document.body.removeChild(container);
});
<br>
Tester's page
<br>
My App
);
render(routes, document.getElementById('app'));
destroy() {
render(null, div);
document.body.removeChild(div);
},
};