Цель: для доступа к modal()
коду Bootstrap Модала в React.
Существует приложение React с Bootstrap v4.
package.json:
{
...
"dependencies": {
"bootstrap": "^4.1.1",
"jquery": "^3.3.1",
"popper.js": "^1.14.3",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-router-dom": "^4.2.2",
"react-scripts-ts": "2.8.0"
},
"scripts": {
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
},
"devDependencies": {
"@types/jest": "^22.2.3",
"@types/node": "^9.6.18",
"@types/react": "^16.3.14",
"@types/react-dom": "^16.0.5",
"@types/react-router-dom": "^4.2.6"
},
...
}
Теперь попытка получить modal()
с помощью Chrome Dev Tools дает:
Так что кажетсякак:
- Это может см. jQuery;
- Это не может распознать
foo
Модальный как Bootstrap's modal()
;
Как заставить jQuery распознавать foo
как modal()
?